Registering an Instance with an AWS OpsWorks Stacks Stack - AWS OpsWorks

Registering an Instance with an AWS OpsWorks Stacks Stack

Important

AWS OpsWorks Stacks is no longer accepting new customers. Existing customers will be able to use the OpsWorks console, API, CLI, and CloudFormation resources as normal until May 26, 2024, at which time they will be discontinued. To prepare for this transition, we recommend you transition your stacks to AWS Systems Manager as soon as possible. For more information, see AWS OpsWorks Stacks End of Life FAQs and Migrating your AWS OpsWorks Stacks applications to AWS Systems Manager Application Manager.

Note

This feature is supported only for Linux stacks.

To register an instance that is outside of AWS OpsWorks Stacks, you run the AWS CLI aws opsworks register command. You can run this command from the instance that you want to register, or from another computer. You apply the AWSOpsWorksRegisterCLI_EC2 or AWSOpsWorksRegisterCLI_OnPremises policies to a user or group to grant permissions required for the AWS CLI to register EC2 or on-premises instances, respectively. These policies require version 1.16.180 of the AWS CLI or newer.

Note

To prevent users or roles from registering instances, update the instance profile to deny access to the register command.

The registration process installs an agent on an instance that you want to manage by using AWS OpsWorks Stacks, and registers the instance with an AWS OpsWorks stack that you specify. After you register an instance, the instance is part of the stack and is managed by AWS OpsWorks Stacks. For more information, see Managing Registered Instances.

Note

Although AWS Tools for PowerShell includes the Register-OpsInstance cmdlet, which calls the register API action, we recommend that you use the AWS CLI to run the register command instead.

The following diagram shows both approaches to registering an Amazon EC2 instance. You can use the same approaches for registering an on-premises instance.

Note

You can use the AWS OpsWorks Stacks console to manage a registered instance, but you must run an AWS CLI register command to register the instance. The reason for this is that the registration process must be run from the instance, which can't be done by the console.

The following sections describe the procedure in detail.