An Amazon Resource Name (ARN) is a unique identifier used in Amazon Web Services (AWS) to specify resources across the AWS ecosystem. ARNs are essential for managing permissions and access control, as they allow users to precisely define which resources they are referring to in their policies and API calls.
The structure of an ARN is standardized and consists of several components, which are separated by colons. The general format is as follows:
arn:partition:service:region:account-id:resource
- Partition: This indicates the AWS partition in which the resource resides. Common partitions include
aws
for standard AWS regions,aws-cn
for AWS China regions, andaws-us-gov
for AWS GovCloud. - Service: This specifies the AWS service that the resource belongs to, such as
s3
for Amazon Simple Storage Service,ec2
for Amazon Elastic Compute Cloud, orlambda
for AWS Lambda. - Region: This denotes the AWS region where the resource is located. For example,
us-east-1
refers to the Northern Virginia region. Some global services, like IAM (Identity and Access Management), do not have a region component. - Account ID: This is the unique identifier for the AWS account that owns the resource. It is a 12-digit number.
- Resource: This part specifies the actual resource identifier, which can vary in format depending on the service. For example, an S3 bucket might be represented as
my-bucket
, while an EC2 instance might be represented asinstance/i-1234567890abcdef0
.
ARNs are crucial for defining permissions in AWS Identity and Access Management (IAM) policies. By using ARNs, administrators can grant or deny access to specific resources, ensuring that users and applications have the appropriate level of access. For instance, an IAM policy might allow a user to perform actions on a specific S3 bucket by referencing its ARN.
In addition to IAM, ARNs are used in various AWS services for resource identification, such as AWS CloudFormation, AWS Lambda, and Amazon SNS (Simple Notification Service). Understanding ARNs is fundamental for anyone working with AWS, as they provide a clear and consistent way to reference resources across the platform, facilitating effective resource management and security practices.