AWS ARN parser
Parse an ARN
Runs in your browser, offline too: the ARN isn’t sent anywhere. ARNs aren’t secret, but they do contain your account ID.
An Amazon Resource Name (ARN) has the form arn:partition:service:region:account-id:resource, for example arn:aws:sns:us-east-1:123456789012:my-topic. The resource part is an ID, or a type and ID joined by / or :, and some ARNs leave fields empty: IAM ARNs have no region, and S3 bucket ARNs have neither region nor account.
The parts of an ARN
ARNs identify a resource unambiguously across all of AWS, which is why IAM policies, resource tags and many API calls ask for them. Every ARN has the same six colon-separated parts, though the resource part can itself contain colons and slashes:
| Part | What it is | Example |
|---|---|---|
arn | Literal prefix | arn |
| partition | The group of regions: aws (AWS Regions), aws-cn (China), aws-us-gov (GovCloud US). The S3 docs also list aws-eusc (European Sovereign Cloud). Each account belongs to one partition. | aws |
| service | The service namespace, which isn’t always the product name: Step Functions is states, EventBridge rules are events, load balancers elasticloadbalancing. | lambda |
| region | The region code, or empty for global resources such as IAM roles, S3 buckets, CloudFront distributions and Route 53 hosted zones. | us-east-2 |
| account-id | The 12-digit ID of the account that owns the resource, without hyphens. Empty for S3 buckets and objects; aws for AWS managed policies. | 123456789012 |
| resource | resource-id, resource-type/resource-id or resource-type:resource-id. It can include a parent resource or a qualifier such as a version. | function:my-function |
ARN formats for 27 common AWS services
Placeholders are in ${…}. These come from each service’s page in the Service Authorization Reference, which lists the ARN format of every resource type you can use in a policy; the STS session formats are from the IAM identifiers page.
| Service | Resource | ARN format |
|---|---|---|
| IAM | user | arn:${Partition}:iam::${Account}:user/${UserNameWithPath} |
| IAM | role | arn:${Partition}:iam::${Account}:role/${RoleNameWithPath} |
| IAM | policy | arn:${Partition}:iam::${Account}:policy/${PolicyNameWithPath} |
| IAM | group | arn:${Partition}:iam::${Account}:group/${GroupNameWithPath} |
| IAM | instance profile | arn:${Partition}:iam::${Account}:instance-profile/${InstanceProfileNameWithPath} |
| IAM | root user | arn:${Partition}:iam::${Account}:root |
| STS | assumed-role session | arn:${Partition}:sts::${Account}:assumed-role/${RoleName}/${RoleSessionName} |
| STS | federated user | arn:${Partition}:sts::${Account}:federated-user/${FederatedUserName} |
| Amazon S3 | bucket | arn:${Partition}:s3:::${BucketName} |
| Amazon S3 | object | arn:${Partition}:s3:::${BucketName}/${ObjectName} |
| Amazon EC2 | instance | arn:${Partition}:ec2:${Region}:${Account}:instance/${InstanceId} |
| Amazon EC2 | VPC | arn:${Partition}:ec2:${Region}:${Account}:vpc/${VpcId} |
| Amazon EC2 | subnet | arn:${Partition}:ec2:${Region}:${Account}:subnet/${SubnetId} |
| Amazon EC2 | security group | arn:${Partition}:ec2:${Region}:${Account}:security-group/${SecurityGroupId} |
| Amazon EC2 | EBS volume | arn:${Partition}:ec2:${Region}:${Account}:volume/${VolumeId} |
| Amazon EC2 | AMI | arn:${Partition}:ec2:${Region}::image/${ImageId} |
| AWS Lambda | function | arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName} |
| AWS Lambda | function version | arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}:${Version} |
| AWS Lambda | function alias | arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}:${Alias} |
| Amazon DynamoDB | table | arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName} |
| Amazon SQS | queue | arn:${Partition}:sqs:${Region}:${Account}:${QueueName} |
| Amazon SNS | topic | arn:${Partition}:sns:${Region}:${Account}:${TopicName} |
| Amazon RDS | DB instance | arn:${Partition}:rds:${Region}:${Account}:db:${DbInstanceName} |
| Amazon RDS | DB cluster | arn:${Partition}:rds:${Region}:${Account}:cluster:${DbClusterInstanceName} |
| Amazon ECS | cluster | arn:${Partition}:ecs:${Region}:${Account}:cluster/${ClusterName} |
| Amazon ECS | service | arn:${Partition}:ecs:${Region}:${Account}:service/${ClusterName}/${ServiceName} |
| Amazon ECS | task | arn:${Partition}:ecs:${Region}:${Account}:task/${ClusterName}/${TaskId} |
| Amazon ECS | task definition | arn:${Partition}:ecs:${Region}:${Account}:task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevisionNumber} |
| Amazon ECR | repository | arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName} |
| Amazon EKS | cluster | arn:${Partition}:eks:${Region}:${Account}:cluster/${ClusterName} |
| AWS KMS | key | arn:${Partition}:kms:${Region}:${Account}:key/${KeyId} |
| AWS KMS | alias | arn:${Partition}:kms:${Region}:${Account}:alias/${Alias} |
| Secrets Manager | secret | arn:${Partition}:secretsmanager:${Region}:${Account}:secret:${SecretId} |
| CloudWatch Logs | log group | arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName} |
| CloudWatch | alarm | arn:${Partition}:cloudwatch:${Region}:${Account}:alarm:${AlarmName} |
| Step Functions | state machine | arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName} |
| Step Functions | execution | arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId} |
| EventBridge | rule (default bus) | arn:${Partition}:events:${Region}:${Account}:rule/${RuleName} |
| EventBridge | rule (custom bus) | arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName} |
| EventBridge | event bus | arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName} |
| EventBridge Scheduler | schedule | arn:${Partition}:scheduler:${Region}:${Account}:schedule/${GroupName}/${ScheduleName} |
| CloudFormation | stack | arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id} |
| API Gateway | REST API | arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId} |
| CloudFront | distribution | arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId} |
| Route 53 | hosted zone | arn:${Partition}:route53:::hostedzone/${Id} |
| Certificate Manager | certificate | arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId} |
| Elastic Load Balancing | Application Load Balancer | arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId} |
| Elastic Load Balancing | target group | arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId} |
| Systems Manager | parameter | arn:${Partition}:ssm:${Region}:${Account}:parameter/${ParameterNameWithoutLeadingSlash} |
| Kinesis Data Streams | stream | arn:${Partition}:kinesis:${Region}:${Account}:stream/${StreamName} |
A few details trip people up. SQS queue and SNS topic ARNs have no resource type, just the name. Lambda ARNs with a version or alias suffix (:prod, :3) are “qualified” and point at that version only. An ECS task definition ARN ends in family:revision. The WithPath IAM names include the path, so a service role looks like role/service-role/MyRole.
Paths, wildcards and incomplete ARNs
- Paths. IAM user, group, role and policy names can have a path, and S3 object keys use slashes like folders. IAM paths may contain letters, numbers and
/ + = , . @ _ -. - Wildcards. In a policy’s
ResourceorNotResourceelement,*matches any characters and?one character:arn:aws:iam::123456789012:role/service-*,arn:aws:s3:::amzn-s3-demo-bucket/????-test, orarn:aws:ec2:*:123456789012:vpc/*for every VPC in every region. You can’t use them inPrincipalorNotPrincipal, in the resource type (functi*), or in the partition. - Incomplete ARNs. In an identity-based policy, an ARN with fewer than six parts is completed with wildcards, so
arn:aws:sqsmeansarn:aws:sqs:*:*:*: every queue in every region and account. Session policies passed to AssumeRole don’t accept incomplete ARNs and fail withMalformedPolicyDocumentException.
Finding an ARN
Most describe-, get- and list- commands return the ARN alongside the name, and the console shows it on the resource’s details page. To see which identity your CLI credentials belong to, run aws sts get-caller-identity: an assumed role appears as arn:aws:sts::123456789012:assumed-role/RoleName/SessionName, which is the session, not the role itself (arn:aws:iam::123456789012:role/RoleName). Use the role ARN in trust and resource policies.
AWS says ARNs aren’t secret, sensitive or confidential, but they do reveal the account ID and resource names, so share them as carefully as any other identifier.
Sources
Questions
What is the format of an AWS ARN?
arn:partition:service:region:account-id:resource. The resource part is a resource ID, or a resource type and ID separated by a slash or a colon, such as role/MyRole or function:my-function. Some ARNs leave the region, the account ID or both empty: S3 bucket ARNs look like arn:aws:s3:::my-bucket.
Why does an IAM or S3 ARN have empty fields (:::)?
IAM is global, so IAM ARNs have no region (arn:aws:iam::123456789012:role/MyRole). S3 bucket names are unique across the partition, so bucket and object ARNs have neither a region nor an account ID (arn:aws:s3:::my-bucket/key).
Is an ARN secret?
No. AWS says ARNs are not considered secret, sensitive or confidential, though like any identifier you should share them carefully. An ARN does contain the account ID and the resource name.
Can I use wildcards in an ARN?
In an IAM policy’s Resource or NotResource element, yes: * matches any characters and ? one character, as in arn:aws:s3:::my-bucket/* or arn:aws:ec2:*:123456789012:vpc/*. Not in Principal or NotPrincipal, not in the resource type (functi*), and not in the partition.
What are the AWS partitions?
aws for the standard AWS Regions, aws-cn for the China Regions and aws-us-gov for AWS GovCloud (US). The S3 documentation also lists aws-eusc for the AWS European Sovereign Cloud. An account belongs to one partition.
How do I find the ARN of my own IAM identity?
Run aws sts get-caller-identity. It returns your account ID and the ARN of the user or assumed-role session your credentials belong to.
CloudConsole’s search finds instances, functions, buckets, databases, log groups, alarms and ECS services by name, ID, ARN or IP, across your accounts and regions, and lets you copy a resource’s ARN or console link. On iPhone and Android.
About the app →