Attaching and Moving Resources - AWS OpsWorks

Attaching and Moving Resources

Important

The AWS OpsWorks Stacks service reached end of life on May 26, 2024 and has been disabled for both new and existing customers. We strongly recommend customers migrate their workloads to other solutions as soon as possible. If you have questions about migration, reach out to the AWS Support Team on AWS re:Post or through AWS Premium Support.

After you register a resource with a stack, you can attach it to one of the stack's instances. You can also move an attached resource from one instance to another. Note the following:

  • When you attach or move Amazon EBS volumes, the instances involved in the operation must be offline. If the instance you are interested in is not on the Resources page, go to the Instances page and stop the instance. After it has stopped, you can return to the Resources page and attach or move the resource.

  • When you attach or move Elastic IP addresses, the instances can be online or offline.

  • If you delete an instance, any attached resources remain registered with the stack. You can then attach the resource to another instance or, if you no longer need it, deregister the resource.

Assigning Amazon EBS Volumes to an Instance

Note

You cannot assign Amazon EBS volumes to Windows instances.

You can assign a registered Amazon EBS volume to an instance and move it from one instance to another, but both instances must be offline.

To assign an Amazon EBS volume to an instance
  1. On the Resources page, click assign to instance in the appropriate volume's Instance column.

  2. On the volume's details page, select the appropriate instance, specify the volume's name and mount point, and click Save to attach the volume to the instance.

Important

If you have assigned an external in-use volume to your instance, you must use the Amazon EC2 console, API, or CLI to unassign it from the original instance or the start process will fail.

You can also use the details page to move an assigned Amazon EBS volume to another instance in the stack.

To move an Amazon EBS volume to another instance
  1. Ensure that both instances are in the offline state.

  2. On the Resources page, click Volumes and then click edit in the volume's Actions column.

  3. Do one of the following:

    • To move the volume to another instance in the stack, select the appropriate instance from the Instance list and click Save.

    • To move the volume to an instance in another stack, deregister the volume, register the volume with the new stack, and attach it to the news instance.

Associating Elastic IP Addresses with an Instance

You can associate a registered Elastic IP address with an instance and move it from one instance to another, including instances in other stacks. The instances can be either online or offline.

To associate an Elastic IP address with an instance
  1. On the Resources page, click associate with instance in the appropriate address's Instance column.

  2. On the address's details page, select the appropriate instance, specify the address's name, and click Save to associate the address with the instance.

Note

If the Elastic IP address is currently associated with another online instance, AWS OpsWorks Stacks automatically reassigns the address to the new instance.

You can also use the details page to move an associated Elastic IP address to another instance.

To move an Elastic IP address to another instance
  1. On the Resources page, click Elastic IPs and click edit in the address's Actions column.

  2. Do one of the following:

    • To move the address to another instance in the stack, select the appropriate instance from the Instance list and click Save.

    • To move the address to an instance in another stack, click change in the Stack settings to see a list of the available stacks. Select a stack from the Stack list and an instance from the Instance list. Then click Save.

After you attach or move an address, AWS OpsWorks Stacks triggers a Configure lifecycle event to notify the stack's instances of the change.

Attaching Amazon RDS Instances to an App

You can attach an Amazon RDS instance to one or more apps.

To attach an Amazon RDS instance to an app
  1. On the Resources page, click Add app in the appropriate instance's Apps column.

  2. Use the Add App page to attach the Amazon RDS instance. For more information, see Adding Apps.

Because an Amazon RDS can be attached to multiple apps, there is no special procedure for moving the instance from one app to another. Just edit the first app to remove the RDS instance or edit the second app to add the RDS instance. For more information, see Editing Apps.