Sharing and using customer managed permissions across accounts in AWS RAM
You can share a customer managed permission that you own the same way that you share other resources: add it
to a resource share as a resource of type ram:Permission. You can share it with other
AWS accounts, organizational units (OUs), your entire organization, or IAM roles and
users in other accounts. Each account can then use your customer managed permission in its own resource shares instead of
creating its own copy.
An account that receives a shared customer managed permission can view it and associate it with its own resource shares. It can't modify, version, deprecate, delete, tag, or reshare the customer managed permission. Only you, the owner, can do those things.
If you share a parameterized managed permission, each receiving account supplies its own parameter values when it associates the permission with its resource shares. For more information, see Using parameterized managed permissions in AWS RAM.
Topics
Share a customer managed permission with other accounts
To share a customer managed permission, create a resource share that includes the customer managed permission as a resource, or add the
customer managed permission to an existing resource share. AWS RAM associates the AWS managed permission
AWSRAMDefaultPermissionRAMCustomerManagedPermission with the
ram:Permission resource type. With this managed permission, the receiving accounts can
view the customer managed permission and its versions and associate it with their own resource shares.
When you add a customer managed permission to a resource share, AWS RAM updates the resource-based policy of the customer managed permission on your behalf. For this to work:
-
The principal that makes the request needs permission for the
ram:PutCustomerManagedPermissionPolicyandram:DeleteCustomerManagedPermissionPolicyactions on the customer managed permission. -
These are permission-only actions. AWS RAM uses them only when it acts on your request, and you can't call them directly.
-
If the principal doesn't have these permissions, the resource association fails with the status message
Association failed because the caller was not authorized.
You can share a customer managed permission only with other AWS accounts, OUs, your organization, or IAM roles and users in other accounts. You can't share a customer managed permission with service principals, and you can't share AWS managed permissions.
Discover and use shared customer managed permissions
You can find and use a shared customer managed permission after you accept the resource share invitation. If you're in the same organization and sharing with AWS Organizations is turned on, you can use it right away.
Stop sharing a customer managed permission
To stop sharing a customer managed permission, remove it or the principals from the resource share, or delete the resource share. After you stop sharing it with an account, the following apply:
-
The account's existing resource shares that use the customer managed permission continue to work.
-
The account no longer sees the customer managed permission in
list-permissions, and it can't associate the customer managed permission with any more resource shares. -
The account can still disassociate the customer managed permission from its existing resource shares.
Considerations for shared customer managed permissions
- See which resource shares use your customer managed permission
-
To list the resource shares in other AWS accounts that use your customer managed permission, run the list-permission-associations command with
--permission-arnand--resource-owner OTHER-ACCOUNTS. Without--resource-owner OTHER-ACCOUNTS, the command lists only your own resource shares. In the console, the permission details page shows the same information under Cross-account usage.$aws ram list-permission-associations \ --permission-arn arn:aws-eusc:ram::123456789012:permission/ParameterReadByTeam \ --resource-owner OTHER-ACCOUNTS - Deletion is blocked while the customer managed permission is in use
-
You can't delete a customer managed permission while any resource share in any AWS account uses it. The request fails with an
OperationNotPermittedExceptionerror. To retire a shared customer managed permission:-
Deprecate it so that no one can associate it with more resource shares. For more information, see Deprecate a customer managed permission.
-
Ask the accounts that use it to disassociate it or to replace it with another managed permission.
-
After the last association is removed, delete it.
-
- Versions
-
When you create a new version of a shared customer managed permission, it becomes the default version immediately. Accounts that use the customer managed permission can associate only the default version. Their existing resource shares keep the version that they use until they update them.
- Regional scope
-
A customer managed permission exists only in the AWS Region where you create it. You can share it only in that Region, and the receiving accounts can use it only for resource shares in that Region.