A SysOps Administrator needs to execute a script on a newly launched Amazon EC2 instance using AWS Systems Manager Run Command. Arrange the following steps in the correct sequential order to configure the instance and run the script.
- 1Attach an IAM instance profile containing the AmazonSSMManagedInstanceCore policy to the EC2 instance.
- 2Verify that the EC2 instance appears under Managed Nodes in the Systems Manager console.
- 3Navigate to the Systems Manager console, select Run Command, and choose the AWS-RunShellScript document.
- 4Specify the target instance and enter the shell command parameters.
- 5Click Run to execute the command, then monitor the output and execution status in the console.
Answer
The correct sequence is: Attach the IAM instance profile to the EC2 instance, verify the instance appears under Managed Nodes, navigate to Run Command to choose the AWS-RunShellScript document, specify the targets and parameters, and then execute the command while monitoring the output.
The correct sequence begins with setting up permissions (attaching the IAM role) so that the instance can register with the Systems Manager service. Once verified in the Managed Nodes list, you select the Run Command interface and choose the execution document (AWS-RunShellScript). You then configure the targets and parameters, and finally execute the script and observe the logs.
Step-by-Step Solution
Key Concept
Configuring EC2 instances for Systems Manager management and executing commands via Run Command.