A cloud engineering team is migrating a legacy payment service to a serverless architecture on AWS. To ensure safe deployments, they intend to implement a canary rollout where of traffic is shifted to the new version for minutes before the remaining traffic is cut over. They write the following AWS SAM template:
yaml
Transform: AWS::Serverless-2016-10-31
Resources:
ProcessPaymentFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs18.x
CodeUri: ./payment
DeploymentPreference:
Type: Canary10Percent10Minutes
After deploying the template, the team observes that the application traffic shifts to the new function version immediately, completely bypassing the -minute canary phase.
What is the root cause of this behavior?
- The AutoPublishAlias property is omitted from the function properties, preventing AWS SAM from generating the Lambda alias and CodeDeploy resources required for traffic shifting.Cevap
- BThe IAM role assigned to the function lacks a trust relationship allowing the AWS CodeDeploy service principal to assume it.
- CThe execution timeout of the function is set to a value shorter than the -minute canary window, causing the deployment to fail back to All-at-Once routing.
- DThe Canary10Percent10Minutes deployment configuration is exclusive to Amazon ECS task sets and cannot be applied to serverless functions.