Amazon Resource Name
lastmod 2023-02-10created 2023-02-102 edits
Amazon Resource Names (ARNs) uniquely identify AWS resources. An ARN is required whenever you need to specify a resource unambiguously across all of AWS, such as in AWS IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.
ARN format
The following is the general format of an ARN. The exact format depends on the resource. In some resources' ARNs, the Region, the account ID, or both the Region and the account ID are omitted.
It starts with arn:, followed by:
-
arn:partition:service:region:account-id:resource-id -
arn:partition:service:region:account-id:resource-type/resource-id -
arn:partition:service:region:account-id:resource-type:resource-id
- partition
- The partition the resource is in. A partition is a group of AWS Regions. Each AWS account is scoped to one partition.
- The supported partitions are:
- aws - AWS Regions
- aws-cn - China Regions
- aws-us-gov - AWS GovCloud (US) Regions
- service
- The service namespace that identifies the AWS product.
- region
- The Region code. For reference, "Asia Pacific (Seoul)" is
ap-northeast-2.
- account-id
- The ID of the AWS account that owns the resource (without hyphens). For example, 123456789012.
- resource-type
- The resource type. For example, vpc for a virtual private cloud (VPC).
- resource-id
- The resource identifier. This is the resource name, the resource ID, or a resource path. Some resource identifiers include a qualifier such as a parent resource (sub-resource-type/parent-resource/sub-resource) or a version (resource-type:resource-name:qualifier).
Paths in ARNs
Resource ARNs can include a path. For example, in Amazon S3, the resource identifier is an object name that can include slashes (/) to form a path. Similarly, IAM user names and group names can include paths.
Paths can include the "match everything" wildcard character, the asterisk (*).
Incorrect wildcard use
You cannot use a wildcard in the part of the ARN that specifies the resource type (for example, the term user in an IAM ARN). For example, the following is not allowed.
Examples
- IAM user
-
arn:aws:iam::123456789012:user/johndoe
- SNS topic
-
arn:aws:sns:us-east-1:123456789012:example-sns-topic-name
- VPC
-
arn:aws:ec2:us-east-1:123456789012:vpc/vpc-0e9801d129EXAMPLE
See also
Favorite site
- Amazon Resource Names (ARNs) - AWS General Reference
- Understanding ARNs in AWS. If you search the official documentation for AWS Regions, AWS is all over the world… | by Harry The Great | Harry's Nomadic Coding | Medium