A SysOps Administrator needs to execute an administrative script across a fleet of Amazon EC2 instances using AWS Systems Manager Run Command. The instances must be targeted as a group based on their department, and they must register successfully as managed instances. Currently, the SSM Agent is installed and running on the instances, and they have outbound internet access, but they do not appear in the Systems Manager console. Which two actions must the SysOps Administrator take to meet these requirements? (Select two.)
- Attach an IAM role containing the AmazonSSMManagedInstanceCore policy to the EC2 instances via an instance profile.Answer
- Apply a resource tag with a department key and value to the EC2 instances, and target them using this tag in Run Command.Answer
- CCreate an IAM policy with iam:PassRole permissions and attach it to the EC2 instances to allow them to assume the Systems Manager service role.
- DConfigure a patch group tag key named Patch Group on the EC2 instances and map it to a custom patch baseline to enable Run Command execution.
- EMigrate the EC2 instances to a private subnet that lacks a route to an Internet Gateway in its route table.
Answer
Attaching an IAM role containing the AmazonSSMManagedInstanceCore policy to the EC2 instances and applying a resource tag to target them dynamically in Run Command are the correct actions.
To successfully execute Run Command on EC2 instances, they must first be registered as managed instances. This requires attaching an IAM role with the AmazonSSMManagedInstanceCore policy to the instances via an instance profile. To target the instances dynamically as a group based on their department, a resource tag (such as Department=Sales) must be applied to the instances, allowing the SysOps Administrator to specify the tag when executing the Run Command.
Step-by-Step Solution
Key Concept
To run commands on EC2 instances using AWS Systems Manager Run Command, instances must be configured as managed instances (requiring the SSM Agent and the AmazonSSMManagedInstanceCore IAM policy) and can be targeted dynamically using resource tags.