Step 2: Register a target node with the maintenance window using the AWS CLI
In this step, you register a target with your new maintenance window. In this case, you specify which node to update when the maintenance window runs.
For an example of registering more than one node at a time using node IDs, examples of using tags to identify multiple nodes, and examples of specifying resource groups as targets, see Examples: Register targets with a maintenance window.
Note
You should already have created an Amazon Elastic Compute Cloud (Amazon EC2) instance to use in this step, as described in the Maintenance Windows tutorial prerequisites.
To register a target node with a maintenance window using the AWS CLI
-
Run the following command on your local machine. Replace each
example resource placeholder
with your own information.The system returns information similar to the following.
{ "WindowTargetId":"e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE" }
-
Now run the following command on your local machine to view details about your maintenance window target.
The system returns information similar to the following.
{ "Targets": [ { "WindowId": "mw-0c50858d01EXAMPLE", "WindowTargetId": "e32eecb2-646c-4f4b-8ed1-205fbEXAMPLE", "ResourceType": "INSTANCE", "Targets": [ { "Key": "InstanceIds", "Values": [ "i-02573cafcfEXAMPLE" ] } ] } ] }
Continue to Step 3: Register a task with the maintenance window using the AWS CLI.