AWS Resource Access Manager
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Authentication and Access Control

You can use IAM policies to control access to certain AWS RAM features and resource sharing capabilities. For more information about IAM policies, see Permissions and Policies in the IAM User Guide. For more information about managing and creating custom IAM policies, see Managing IAM Policies.

IAM Policies for AWS RAM

By default, IAM users don't have permission to create or modify AWS RAM resources. To allow IAM users to create or modify resources and perform tasks, you must create IAM policies that grant permission to use specific resources and API actions. You then attach those policies to the IAM users or groups that require those permissions.

An IAM policy is a JSON document that includes the following statements: Effect, Action, Resource, and Condition. An IAM policy typically takes the following form:

{ "Statement":[{ "Effect":"effect", "Action":"action", "Resource":"arn", "Condition":{ "condition":{ "key":"value" } } }] }

Effect

The Effect statement indicates whether the policy allows or denies a user permission to perform an action. The possible values include: Allow and Deny.

Action

The Action statement specifies the AWS RAM API actions for which the policy is allowing or denying permission. For a complete list of the allowed actions, see Actions Defined by AWS Resource Access Manager in the IAM User Guide.

Resource

The Resource statement specifies the AWS RAM resources that are affected by the policy. To specify a resource in the statement, you need to use its unique Amazon Resource Name (ARN). For a complete list of the allowed resources, see Resources Defined by AWS Resource Access Manager in the IAM User Guide.

Condition

Condition statements are optional. They can be used to further refine the conditions under which the policy applies. AWS RAM supports the following condition keys:

  • aws:RequestTag/${TagKey} — Specifies a tag key and value pair that must be used when creating or tagging a resource share.

  • aws:ResourceTag/${TagKey} — Indicates that the action can be performed only on resources that have the specified tag key and value pair.

  • aws:TagKeys — Specifies the tag keys that can be used when creating or tagging a resource share.

  • ram:AllowsExternalPrincipals — Indicates that the action can be performed only on resource shares that allow or deny sharing with external principals. An external principal is an AWS account outside of your AWS organization

  • ram:Principal — Indicates that the action can be performed only on the specified principal.

  • ram:RequestedResourceType — Indicates that the action can be performed only on the specified resource type. Resource types must be specified in the following format:

    • ec2:CapacityReservation

    • ec2:Subnet

    • ec2:TrafficMirrorTarget

    • ec2:TransitGateway

    • license-manager:LicenseConfiguration

    • rds:Cluster

    • route53resolver:ResolverRule

  • ram:ResourceArn — Indicates that the action can be performed only on a resource with the specified ARN.

  • ram:ResourceShareName — Indicates that the action can be performed only on a resource share with the specified name.

  • ram:ShareOwnerAccountId — Indicates that the action can be performed only on resource shares owned by a specific account.

Example IAM Policies

Example 1: Allow Sharing of Specific Resources

You can use an IAM policy to restrict principals to associating only specific resources with resource shares.

For example, the following policy limits principals to sharing only the resolver rule with the specified Amazon Resource Name (ARN).

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["ram:CreateResourceShare", "ram:AssociateResourceShare"], "Resource": "*", "Condition": { "StringEquals": { "ram:ResourceArn": "arn:aws:route53resolver:us-west-2:123456789012:resolver-rule/rslvr-rr-5328a0899aexample" } } }] }

Example 2: Allow Sharing of Specific Resource Types

You can use an IAM policy to limit principals to associating only specific resource types with resource shares.

For example, the following policy limits principals to sharing only resolver rules.

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["ram:CreateResourceShare", "ram:AssociateResourceShare"], "Resource": "*", "Condition": { "StringEquals": { "ram:RequestedResourceType": "route53resolver:ResolverRule" } } }] }

Example 3: Restrict Sharing with External AWS Accounts

You can use an IAM policy to prevent principals from sharing resources with AWS accounts that are outside of its AWS organization.

For example, the following IAM policy prevents principals from adding external AWS accounts to resource shares.

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "ram:CreateResourceShare", "Resource": "*", "Condition": { "Bool": { "ram:AllowsExternalPrincipals": "false" } } }] }