A company uses AWS Directory Service for Microsoft Active Directory as its identity provider and requires all infrastructure to be provisioned with AWS CloudFormation. A DevOps engineer created a CloudFormation template that defines an EC2 launch template, an IAM role, an EC2 security group, and an Auto Scaling group for Windows EC2 instances. All EC2 instances must be automatically joined to the AWS Managed Microsoft AD domain. Which approach provides the required domain join with the greatest operational efficiency?
Choose an answer
Tap an option to check your answer.
Correct answer: In the CloudFormation template, add tags to the launch template that are propagated at instance launch. Create an AWS::SSM::Association that runs the AWS-JoinDirectoryServiceDomain Automation runbook for instances that have those tags, supplying the parameters needed to join the AWS Managed Microsoft AD directory. Attach the AmazonSSMManagedInstanceCore and AmazonSSMDirectoryServiceAccess managed policies to the IAM role used by the instances..
Why this is the answer
The correct option uses an AWS Systems Manager (SSM) Association to automatically join instances to the domain. By tagging instances via the launch template and creating an SSM Association targeting those tags, the AWS-JoinDirectoryServiceDomain runbook will execute automatically. This is operationally efficient because it's declarative in CloudFormation and requires no manual intervention or custom scripts. The AmazonSSMManagedInstanceCore policy allows instances to be managed by SSM, and AmazonSSMDirectoryServiceAccess grants permissions for domain join operations. The incorrect options are less efficient or secure: Creating an AWS::SSM::Document and referencing it in the launch template is a valid approach but less streamlined than using the pre-built AWS-JoinDirectoryServiceDomain runbook. Using AWS-CreateManagedWindowsInstanceWithApproval is designed for creating new instances with approval workflows, not for joining existing instances or instances launched via Auto Scaling groups to a domain. Storing domain administrator credentials in Secrets Manager and using user data to retrieve them is less secure and less operationally efficient than using SSM's built-in domain join capabilities, as it involves managing sensitive credentials directly within instance boot scripts.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed