An enterprise manages its multi-account environment using AWS Organizations. The central platform team maintains a dedicated CI/CD tooling account, while applications run in separate member accounts. A critical microservice hosted on Amazon ECS (Fargate) in a member application account needs its deployment process automated.
The platform team designs a cross-account pipeline in the tooling account using AWS CodePipeline. The pipeline builds the container image, pushes it to Amazon ECR, and triggers AWS CodeDeploy in the member application account to perform a blue/green deployment. The deployment must meet these requirements:
- Shift of traffic to the new version, wait exactly minutes, and then shift the remaining of traffic.
- Automatically roll back the deployment if the HTTP error count on the production listener spikes during traffic shifting.
- Maintain a secure, cross-account artifact sharing model with minimal operational overhead.
Which configuration will meet these requirements?
- AEncrypt the S3 artifact bucket in the tooling account with a Customer Managed Key (CMK). Grant the cross-account execution role in the application account decrypt and read permissions on the CMK and S3 bucket. In the application account, configure the CodeDeploy deployment group to use the predefined ECSLinear10PercentEvery1Minute deployment configuration, and associate the deployment group with a CloudWatch alarm monitoring HTTPCode_Target_5XX_Count on the Application Load Balancer's production listener.
- Encrypt the S3 artifact bucket in the tooling account with a Customer Managed Key (CMK). Grant the cross-account execution role in the application account decrypt and read permissions on the CMK and S3 bucket. In the application account, create a custom CodeDeploy deployment configuration with a traffic routing type of TimeBasedCanary, a CanaryPercentage of 10%, and a CanaryInterval of 10 minutes. Associate the CodeDeploy deployment group with a CloudWatch alarm monitoring HTTPCode_Target_5XX_Count on the Application Load Balancer's production listener.Answer
- CEncrypt the S3 artifact bucket in the tooling account with the default AWS-managed KMS key (aws/s3). Grant the cross-account execution role in the application account read permissions on the S3 bucket. In the application account, create a custom CodeDeploy deployment configuration with a traffic routing type of TimeBasedCanary, a CanaryPercentage of 10%, and a CanaryInterval of 10 minutes. Associate the CodeDeploy deployment group with a CloudWatch alarm monitoring HTTPCode_Target_5XX_Count on the Application Load Balancer's production listener.
- DEncrypt the S3 artifact bucket in the tooling account with a Customer Managed Key (CMK). Apply a Service Control Policy (SCP) to the Organizational Unit of the application account that allows the cross-account execution role to access the S3 bucket and decrypt using the CMK. In the application account, create a custom CodeDeploy deployment configuration with a traffic routing type of TimeBasedCanary, a CanaryPercentage of 10%, and a CanaryInterval of 10 minutes. Associate the CodeDeploy deployment group with a CloudWatch alarm monitoring HTTPCode_Target_5XX_Count on the Application Load Balancer's production listener.