A global retail company runs a containerized microservices application on Amazon ECS (with Amazon EC2 launch type) across a multi-account environment managed by AWS Organizations. The EC2 container instances are configured and maintained using AWS Systems Manager (SSM) State Manager associations. Recently, local SRE teams in the spoke accounts have been manually modifying the SSM State Manager associations and direct EC2 configurations to troubleshoot issues, leading to widespread compliance violations and deployment failures due to configuration drift. The Solutions Architect must implement a strategy to automate drift remediation for these associations and prevent unauthorized local modifications. Which strategy should the Solutions Architect implement to meet these requirements with the least operational overhead?
- Deploy an AWS Config organization conformance pack containing the ssm-association-compliance-status rule. Associate an AWS Systems Manager Automation runbook as the remediation target to automatically update the association back to its defined state when non-compliance is detected. Implement a Service Control Policy (SCP) at the organizational unit (OU) level that denies ssm:UpdateAssociation and ssm:DeleteAssociation actions, unless the calling principal is the central CloudFormation administration IAM role.Answer
- BDeploy an AWS Config organization conformance pack that includes the ssm-association-compliance-status rule. Attach a Service Control Policy (SCP) to the spoke accounts' OU that denies ssm:UpdateAssociation and ssm:DeleteAssociation for all IAM identities to prevent local drift, and configure AWS Config to trigger a Lambda function that logs the non-compliant events to a central Amazon S3 bucket.
- CStore the SSM association parameters in Systems Manager Parameter Store encrypted with the default AWS-managed KMS key (aws/ssm). Edit the key policy of the aws/ssm key to deny decrypt permissions to all local spoke account administrators, and configure a State Manager association to poll the Parameter Store every 15 minutes to overwrite local changes.
- DConfigure AWS CodePipeline to run an AWS CodeDeploy deployment with a linear deployment strategy that redeploys the ECS container instances on a daily schedule. Use a CloudFormation drift detection action linked to an Amazon EventBridge rule to delete and recreate the CloudFormation stack in the spoke accounts if any configuration drift is reported.