CloudConsole

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.

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:

ARN parts
PartWhat it isExample
arnLiteral prefixarn
partitionThe 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
serviceThe service namespace, which isn’t always the product name: Step Functions is states, EventBridge rules are events, load balancers elasticloadbalancing.lambda
regionThe region code, or empty for global resources such as IAM roles, S3 buckets, CloudFront distributions and Route 53 hosted zones.us-east-2
account-idThe 12-digit ID of the account that owns the resource, without hyphens. Empty for S3 buckets and objects; aws for AWS managed policies.123456789012
resourceresource-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.

ARN formats by service and resource type
ServiceResourceARN format
IAMuserarn:${Partition}:iam::${Account}:user/${UserNameWithPath}
IAMrolearn:${Partition}:iam::${Account}:role/${RoleNameWithPath}
IAMpolicyarn:${Partition}:iam::${Account}:policy/${PolicyNameWithPath}
IAMgrouparn:${Partition}:iam::${Account}:group/${GroupNameWithPath}
IAMinstance profilearn:${Partition}:iam::${Account}:instance-profile/${InstanceProfileNameWithPath}
IAMroot userarn:${Partition}:iam::${Account}:root
STSassumed-role sessionarn:${Partition}:sts::${Account}:assumed-role/${RoleName}/${RoleSessionName}
STSfederated userarn:${Partition}:sts::${Account}:federated-user/${FederatedUserName}
Amazon S3bucketarn:${Partition}:s3:::${BucketName}
Amazon S3objectarn:${Partition}:s3:::${BucketName}/${ObjectName}
Amazon EC2instancearn:${Partition}:ec2:${Region}:${Account}:instance/${InstanceId}
Amazon EC2VPCarn:${Partition}:ec2:${Region}:${Account}:vpc/${VpcId}
Amazon EC2subnetarn:${Partition}:ec2:${Region}:${Account}:subnet/${SubnetId}
Amazon EC2security grouparn:${Partition}:ec2:${Region}:${Account}:security-group/${SecurityGroupId}
Amazon EC2EBS volumearn:${Partition}:ec2:${Region}:${Account}:volume/${VolumeId}
Amazon EC2AMIarn:${Partition}:ec2:${Region}::image/${ImageId}
AWS Lambdafunctionarn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}
AWS Lambdafunction versionarn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}:${Version}
AWS Lambdafunction aliasarn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}:${Alias}
Amazon DynamoDBtablearn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}
Amazon SQSqueuearn:${Partition}:sqs:${Region}:${Account}:${QueueName}
Amazon SNStopicarn:${Partition}:sns:${Region}:${Account}:${TopicName}
Amazon RDSDB instancearn:${Partition}:rds:${Region}:${Account}:db:${DbInstanceName}
Amazon RDSDB clusterarn:${Partition}:rds:${Region}:${Account}:cluster:${DbClusterInstanceName}
Amazon ECSclusterarn:${Partition}:ecs:${Region}:${Account}:cluster/${ClusterName}
Amazon ECSservicearn:${Partition}:ecs:${Region}:${Account}:service/${ClusterName}/${ServiceName}
Amazon ECStaskarn:${Partition}:ecs:${Region}:${Account}:task/${ClusterName}/${TaskId}
Amazon ECStask definitionarn:${Partition}:ecs:${Region}:${Account}:task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevisionNumber}
Amazon ECRrepositoryarn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}
Amazon EKSclusterarn:${Partition}:eks:${Region}:${Account}:cluster/${ClusterName}
AWS KMSkeyarn:${Partition}:kms:${Region}:${Account}:key/${KeyId}
AWS KMSaliasarn:${Partition}:kms:${Region}:${Account}:alias/${Alias}
Secrets Managersecretarn:${Partition}:secretsmanager:${Region}:${Account}:secret:${SecretId}
CloudWatch Logslog grouparn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}
CloudWatchalarmarn:${Partition}:cloudwatch:${Region}:${Account}:alarm:${AlarmName}
Step Functionsstate machinearn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}
Step Functionsexecutionarn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}
EventBridgerule (default bus)arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}
EventBridgerule (custom bus)arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}
EventBridgeevent busarn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}
EventBridge Schedulerschedulearn:${Partition}:scheduler:${Region}:${Account}:schedule/${GroupName}/${ScheduleName}
CloudFormationstackarn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}
API GatewayREST APIarn:${Partition}:apigateway:${Region}::/restapis/${RestApiId}
CloudFrontdistributionarn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}
Route 53hosted zonearn:${Partition}:route53:::hostedzone/${Id}
Certificate Managercertificatearn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}
Elastic Load BalancingApplication Load Balancerarn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}
Elastic Load Balancingtarget grouparn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}
Systems Managerparameterarn:${Partition}:ssm:${Region}:${Account}:parameter/${ParameterNameWithoutLeadingSlash}
Kinesis Data Streamsstreamarn:${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

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 →