Question

Difficulty: MediumAWS Systems Manager Configuration and Run Command Automation

A SysOps Administrator needs to execute a custom bash script on several on-premises servers using AWS Systems Manager Run Command. The on-premises servers are not yet registered with AWS. An IAM service role for Systems Manager hybrid activation has already been created.

What is the correct sequence of steps to register these on-premises servers and execute the script?

  1. 1Create a hybrid activation in the AWS Systems Manager console or via the AWS CLI to generate an Activation ID and Activation Code.
  2. 2Install the SSM Agent on the physical servers and run the registration command using the Activation ID, Activation Code, and target Region.
  3. 3Verify that the registered servers are listed as managed nodes (with the mi- prefix) in the Systems Manager console.
  4. 4Execute the script using Run Command by selecting the AWS-RunShellScript document and targeting the managed nodes.

Answer

First, create a hybrid activation to get the Activation ID and Activation Code. Second, install the SSM Agent on the on-premises servers and register them using the activation details. Third, verify that the servers appear as managed nodes in the Systems Manager console. Fourth, execute the command using AWS-RunShellScript targeting the managed nodes.
The registration process must begin with creating the activation credentials, then applying them locally to the hybrid servers. Only after confirming they are registered as managed nodes can commands be executed on them.

Step-by-Step Solution

1
Create a hybrid activation in Systems Manager.
Activation ID and Activation Code are generated.
These credentials allow the hybrid instances to securely register with AWS Systems Manager.
2
Install SSM Agent and register on-premises servers.
The SSM Agent registers with Systems Manager.
The on-premises servers require the agent and registration credentials to join the AWS account's managed fleet.
3
Verify instances appear as managed nodes.
Instances appear with the 'mi-' prefix.
Ensures that the agent is properly communicating and ready to receive commands.
4
Execute Run Command.
Run Command successfully targets the instances and runs the script.
Once the target nodes are managed, standard SSM Run Command documents can be targeted to them.

Key Concept

AWS Systems Manager hybrid activations and Run Command execution sequence
Rate this question