# AWS ARN parser

Free, in your browser · ARN formats for 27 services · works offline

## 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.

Screenshot: The Tools list in the app, with Open by ARN under Find and open

In the CloudConsole app

## Run this on your own account

In the app, Open by ARN checks a pasted or scanned ARN with this same parser, then opens the resource on its own screen, switching to the right account and region first.

[How Open by ARN works →](https://cloudconsole.dev/help/tools)

[Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710) · [Get it on Google Play](https://play.google.com/store/apps/details?id=com.cloudconsole.app)

**Short answer**

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](https://docs.aws.amazon.com/service-authorization/latest/reference/list_iam.html) | user | `arn:${Partition}:iam::${Account}:user/${UserNameWithPath}` |
| [IAM](https://docs.aws.amazon.com/service-authorization/latest/reference/list_iam.html) | role | `arn:${Partition}:iam::${Account}:role/${RoleNameWithPath}` |
| [IAM](https://docs.aws.amazon.com/service-authorization/latest/reference/list_iam.html) | policy | `arn:${Partition}:iam::${Account}:policy/${PolicyNameWithPath}` |
| [IAM](https://docs.aws.amazon.com/service-authorization/latest/reference/list_iam.html) | group | `arn:${Partition}:iam::${Account}:group/${GroupNameWithPath}` |
| [IAM](https://docs.aws.amazon.com/service-authorization/latest/reference/list_iam.html) | instance profile | `arn:${Partition}:iam::${Account}:instance-profile/${InstanceProfileNameWithPath}` |
| [IAM](https://docs.aws.amazon.com/service-authorization/latest/reference/list_iam.html) | root user | `arn:${Partition}:iam::${Account}:root` |
| [STS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_sts.html) | assumed-role session | `arn:${Partition}:sts::${Account}:assumed-role/${RoleName}/${RoleSessionName}` |
| [STS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_sts.html) | federated user | `arn:${Partition}:sts::${Account}:federated-user/${FederatedUserName}` |
| [Amazon S3](https://docs.aws.amazon.com/service-authorization/latest/reference/list_s3.html) | bucket | `arn:${Partition}:s3:::${BucketName}` |
| [Amazon S3](https://docs.aws.amazon.com/service-authorization/latest/reference/list_s3.html) | object | `arn:${Partition}:s3:::${BucketName}/${ObjectName}` |
| [Amazon EC2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ec2.html) | instance | `arn:${Partition}:ec2:${Region}:${Account}:instance/${InstanceId}` |
| [Amazon EC2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ec2.html) | VPC | `arn:${Partition}:ec2:${Region}:${Account}:vpc/${VpcId}` |
| [Amazon EC2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ec2.html) | subnet | `arn:${Partition}:ec2:${Region}:${Account}:subnet/${SubnetId}` |
| [Amazon EC2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ec2.html) | security group | `arn:${Partition}:ec2:${Region}:${Account}:security-group/${SecurityGroupId}` |
| [Amazon EC2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ec2.html) | EBS volume | `arn:${Partition}:ec2:${Region}:${Account}:volume/${VolumeId}` |
| [Amazon EC2](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ec2.html) | AMI | `arn:${Partition}:ec2:${Region}::image/${ImageId}` |
| [AWS Lambda](https://docs.aws.amazon.com/service-authorization/latest/reference/list_lambda.html) | function | `arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}` |
| [AWS Lambda](https://docs.aws.amazon.com/service-authorization/latest/reference/list_lambda.html) | function version | `arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}:${Version}` |
| [AWS Lambda](https://docs.aws.amazon.com/service-authorization/latest/reference/list_lambda.html) | function alias | `arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}:${Alias}` |
| [Amazon DynamoDB](https://docs.aws.amazon.com/service-authorization/latest/reference/list_dynamodb.html) | table | `arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}` |
| [Amazon SQS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_sqs.html) | queue | `arn:${Partition}:sqs:${Region}:${Account}:${QueueName}` |
| [Amazon SNS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_sns.html) | topic | `arn:${Partition}:sns:${Region}:${Account}:${TopicName}` |
| [Amazon RDS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_rds.html) | DB instance | `arn:${Partition}:rds:${Region}:${Account}:db:${DbInstanceName}` |
| [Amazon RDS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_rds.html) | DB cluster | `arn:${Partition}:rds:${Region}:${Account}:cluster:${DbClusterInstanceName}` |
| [Amazon ECS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ecs.html) | cluster | `arn:${Partition}:ecs:${Region}:${Account}:cluster/${ClusterName}` |
| [Amazon ECS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ecs.html) | service | `arn:${Partition}:ecs:${Region}:${Account}:service/${ClusterName}/${ServiceName}` |
| [Amazon ECS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ecs.html) | task | `arn:${Partition}:ecs:${Region}:${Account}:task/${ClusterName}/${TaskId}` |
| [Amazon ECS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ecs.html) | task definition | `arn:${Partition}:ecs:${Region}:${Account}:task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevisionNumber}` |
| [Amazon ECR](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ecr.html) | repository | `arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}` |
| [Amazon EKS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_eks.html) | cluster | `arn:${Partition}:eks:${Region}:${Account}:cluster/${ClusterName}` |
| [AWS KMS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_kms.html) | key | `arn:${Partition}:kms:${Region}:${Account}:key/${KeyId}` |
| [AWS KMS](https://docs.aws.amazon.com/service-authorization/latest/reference/list_kms.html) | alias | `arn:${Partition}:kms:${Region}:${Account}:alias/${Alias}` |
| [Secrets Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_secretsmanager.html) | secret | `arn:${Partition}:secretsmanager:${Region}:${Account}:secret:${SecretId}` |
| [CloudWatch Logs](https://docs.aws.amazon.com/service-authorization/latest/reference/list_logs.html) | log group | `arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}` |
| [CloudWatch](https://docs.aws.amazon.com/service-authorization/latest/reference/list_cloudwatch.html) | alarm | `arn:${Partition}:cloudwatch:${Region}:${Account}:alarm:${AlarmName}` |
| [Step Functions](https://docs.aws.amazon.com/service-authorization/latest/reference/list_stepfunctions.html) | state machine | `arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}` |
| [Step Functions](https://docs.aws.amazon.com/service-authorization/latest/reference/list_stepfunctions.html) | execution | `arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}` |
| [EventBridge](https://docs.aws.amazon.com/service-authorization/latest/reference/list_eventbridge.html) | rule (default bus) | `arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}` |
| [EventBridge](https://docs.aws.amazon.com/service-authorization/latest/reference/list_eventbridge.html) | rule (custom bus) | `arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}` |
| [EventBridge](https://docs.aws.amazon.com/service-authorization/latest/reference/list_eventbridge.html) | event bus | `arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}` |
| [EventBridge Scheduler](https://docs.aws.amazon.com/service-authorization/latest/reference/list_scheduler.html) | schedule | `arn:${Partition}:scheduler:${Region}:${Account}:schedule/${GroupName}/${ScheduleName}` |
| [CloudFormation](https://docs.aws.amazon.com/service-authorization/latest/reference/list_cloudformation.html) | stack | `arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}` |
| [API Gateway](https://docs.aws.amazon.com/service-authorization/latest/reference/list_apigateway.html) | REST API | `arn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}` |
| [CloudFront](https://docs.aws.amazon.com/service-authorization/latest/reference/list_cloudfront.html) | distribution | `arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}` |
| [Route 53](https://docs.aws.amazon.com/service-authorization/latest/reference/list_route53.html) | hosted zone | `arn:${Partition}:route53:::hostedzone/${Id}` |
| [Certificate Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_acm.html) | certificate | `arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}` |
| [Elastic Load Balancing](https://docs.aws.amazon.com/service-authorization/latest/reference/list_elbv2.html) | Application Load Balancer | `arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}` |
| [Elastic Load Balancing](https://docs.aws.amazon.com/service-authorization/latest/reference/list_elbv2.html) | target group | `arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}` |
| [Systems Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_ssm.html) | parameter | `arn:${Partition}:ssm:${Region}:${Account}:parameter/${ParameterNameWithoutLeadingSlash}` |
| [Kinesis Data Streams](https://docs.aws.amazon.com/service-authorization/latest/reference/list_kinesis.html) | 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 `Resource` or `NotResource` element, `*` matches any characters and `?` one character: `arn:aws:iam::123456789012:role/service-*`, `arn:aws:s3:::amzn-s3-demo-bucket/????-test`, or `arn:aws:ec2:*:123456789012:vpc/*` for every VPC in every region. You can’t use them in `Principal` or `NotPrincipal`, 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:sqs` means `arn:aws:sqs:*:*:*`: every queue in every region and account. Session policies passed to AssumeRole don’t accept incomplete ARNs and fail with `MalformedPolicyDocumentException`.

## 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

- [IAM User Guide: Identify AWS resources with Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html)
- [IAM User Guide: IAM identifiers (IAM and STS ARNs)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
- [Service Authorization Reference: actions, resources and condition keys for each service](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html)
- [Amazon S3 User Guide: General purpose bucket naming rules (partitions)](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html)

## 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.

**Look a resource up by its ARN**

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 →](https://cloudconsole.dev/aws-console-app)

## Related

- [AccessDeniedException: User is not authorized to perform this action because no identity-based policy allows it](https://cloudconsole.dev/errors/accessdenied-no-identity-based-policy-allows) – AWS error fix
- [AccessDenied: User is not authorized to perform: sts:AssumeRole](https://cloudconsole.dev/errors/not-authorized-to-perform-sts-assumerole) – AWS error fix
- [aws sts get-caller-identity](https://cloudconsole.dev/cli/sts-get-caller-identity) – AWS CLI
- [aws iam simulate-principal-policy](https://cloudconsole.dev/cli/iam-simulate-principal-policy) – AWS CLI
- [AWS cron expression builder](https://cloudconsole.dev/tools/eventbridge-cron-builder) – Free tool
- [S3 bucket name checker](https://cloudconsole.dev/tools/s3-bucket-name-checker) – Free tool

---

Source: https://cloudconsole.dev/tools/arn-parser

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
