Step 2: Register a target node with the maintenance window (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.
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 (AWS CLI)
-
Run the following command on your local machine. Replace each
example resource placeholder
with your own information.The system returns information like 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 like 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 (AWS CLI).