Share a placement group - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Share a placement group

Placement group sharing allows you to influence the placement of interdependent instances that are owned by separate Amazon accounts. You can share a placement group across multiple Amazon accounts or within your organizations. You can launch instances in a shared placement group.

A placement group owner can share a placement group with:

  • Specific Amazon accounts inside or outside of its organization

  • An organizational unit inside its organization

  • Its entire organization

Note

The Amazon account from which you want to share a placement group must have the following permissions in the IAM policy.

  • ec2:PutResourcePolicy

  • ec2:DeleteResourcePolicy

Rules and limitations

The following rules and limitations apply when you share a placement group or when a placement group is shared with you.

  • To share a placement group, you must own it in your Amazon account. You cannot share a placement group that has been shared with you.

  • When you share a partition or spread placement group, the placement group limits do not change. A shared partition placement group supports a maximum of seven partitions per Availability Zone, and a shared spread placement group supports a maximum of seven running instances per Availability Zone.

  • To share a placement group with your organization or an organizational unit in your organization, you must enable sharing with Amazon Organizations. For more information, see Sharing your Amazon resources.

  • You are responsible for managing the instances owned by you in a shared placement group.

  • You cannot view or modify instances and capacity reservations that are associated with a shared placement group but not owned by you.

Share across Availability Zones

To ensure that resources are distributed across the Availability Zones for a Region, we independently map Availability Zones to names for each account. This could lead to Availability Zone naming differences across accounts. For example, the Availability Zone us-east-1a for your Amazon account might not have the same location as us-east-1a for another Amazon account.

To identify the location of your Dedicated Hosts relative to your accounts, you must use the Availability Zone ID (AZ ID). The Availability Zone ID is a unique and consistent identifier for an Availability Zone across all Amazon accounts. For example, use1-az1 is an Availability Zone ID for the us-east-1 Region and it is the same location in every Amazon account.

To view the Availability Zone IDs for the Availability Zones in your account
  1. Open the Amazon RAM console at https://console.amazonaws.cn/ram.

  2. The Availability Zone IDs for the current Region are displayed under Your AZ ID in the right panel.

Share a placement group

To share a placement group, you must add it to a resource share. A resource share is an Amazon RAM resource that lets you share your resources across Amazon accounts. A resource share specifies the resources to share, and the consumers with whom they are shared.

If you are part of an organization in Amazon Organizations sharing within your organization is enabled, consumers in your organization are granted access to the shared placement group.

If the placement group is shared with an Amazon account outside of your organization, the Amazon account owner will receive an invitation to join the resource share. They can access the shared placement group after accepting the invitation.

You can share a placement group across Amazon accounts using https://console.amazonaws.cn/ram or Amazon CLI.

Amazon RAM console

To share a placement group you own using https://console.amazonaws.cn/ram, see Creating a resource share.

Amazon CLI

To share a placement group you own, use the create-resource-share command.

Identify a shared placement group

The Amazon Resource Name (ARN) of a placement group contains the 12-digit account ID of the account that owns the placement group. You can use the account ID to identify the owner of a placement group that is shared with you.

You can find the placement group ARN using one of the following methods. For more information, see View placement group information.

Amazon EC2 console
To identify a shared placement group
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. In the navigation pane, under Network & Security, choose Placement Groups.

  3. The Placement groups table lists all the placement groups that are owned by you and shared with you. The Group ARN column displays the placement group ARN.

    If the Group ARN column isn't visible, choose settings ( 
                                            Settings icon.
                                        ) in the top-right corner, turn on Group ARN, and choose Confirm.

Amazon CLI
To identify a shared placement group

Use describe-placement-groups command to list all the placement groups that are owned by you and shared with you. In the response, the GroupId parameter displays the ARN of a placement group.

Launch an instance in a shared placement group

Important

When using the Amazon CLI to launch an instance in a shared placement group, you must specify the placement group ID by using the GroupId parameter.

You can use the placement group name only if you're the owner of the placement group being shared. We recommend using the placement group ID to avoid potential placement group name collisions between Amazon accounts.

You can find the ID of a placement group in the Amazon EC2 console on the Placement Groups screen or by using the describe-placement-groups Amazon CLI command. For more information, see View placement group information.

Console
To launch instances into a shared placement group
  1. Follow the procedure to launch an instance, but don't launch the instance until you've completed the following steps to specify the settings for the placement group.

  2. Under Instance type, select a supported instance type. For more information, see Placement group rules and limitations.

  3. Expand Advanced details, and configure the placement group settings as follows:

    1. For Placement group, select the placement group that was shared with you.

      Note

      If there are placement groups with the same name, check the placement group ID to make sure that you select the correct placement group.

    2. If you choose a placement group with a partition strategy, for Target partition, choose the partition in which to launch the instance.

  4. In the Summary panel, do the following:

    1. For Number of instances, enter the total number of instances that you need in this placement group, because you might not be able to add instances to the placement group later.

    2. Review your instance configuration, and then choose Launch instance.

For more information, see Launch an instance using the new launch instance wizard.

Amazon CLI

To launch instances in a shared placement group

Use the run-instances command and specify the placement group ID of the shared placement group.

aws ec2 run-instances —-placement "GroupId = pg-0123456789example"

To launch instances into a specific partition of a shared partition placement group

Use the run-instances command and specify the placement group ID and the partition number of the shared placement group.

aws ec2 run-instances —-placement "GroupId = pg-0123456789example, PartitionNumber = 3"
Tip

Use VPC peering to connect instances owned by separate Amazon accounts and get the full latency benefits offered by shared cluster placement groups. For more information, see What is VPC peering?

Unshare a shared placement group

The placement group owner can unshare a shared placement group at any time.

When you unshare a shared placement group, the following changes will take effect.

  • The Amazon accounts with which a placement group was shared will no longer be able to launch instances or reserve capacity.

  • If your instances were running in a shared placement group, they will be disassociated from the placement group but continue to run normally in your Amazon account.

  • If you had capacity reservations in a shared placement group, they will be disassociated from the placement group but you will continue to have access to them in your Amazon account.

You can unshare a shared placement group using one of the following methods.

Amazon RAM console

To unshare a shared placement group using https://console.amazonaws.cn/ram, see Deleting a resource share.

Amazon CLI

To unshare a shared placement group using Amazon Command Line Interface, use the disassociate-resource-share command.