Amazon Resource Names (ARNs) and AWS Service Namespaces
Amazon Resource Names (ARNs) uniquely identify AWS resources. We require an ARN when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.
ARN Format
Here are some example ARNs:
<!-- Elastic Beanstalk application version -->
arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment
<!-- IAM user name -->
arn:aws:iam::123456789012:user/David
<!-- Amazon RDS tag -->
arn:aws:rds:eu-west-1:001234567890:db:mysql-db
<!-- Amazon S3 bucket (and all objects in it)-->
arn:aws:s3:::my_corporate_bucket/*The following are the general formats for ARNs; the specific components and values used depend on the AWS service.
arn:partition:service:region:account-id:resource
arn:partition:service:region:account-id:resourcetype/resource
arn:partition:service:region:account-id:resourcetype:resourcepartitionThe partition that the resource is in. For standard AWS regions, the partition is
aws. If you have resources in other partitions, the partition isaws-. For example, the partition for resources in the China (Beijing) region ispartitionnameaws-cn.serviceThe service namespace that identifies the AWS product (for example, Amazon S3, IAM, or Amazon RDS). For a list of namespaces, see AWS Service Namespaces.
regionThe region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.
accountThe ID of the AWS account that owns the resource, without the hyphens. For example, 123456789012. Note that the ARNs for some resources don't require an account number, so this component might be omitted.
resource,resourcetype:resource, orresourcetype/resourceThe content of this part of the ARN varies by service. It often includes an indicator of the type of resource—for example, an IAM user or Amazon RDS database —followed by a slash (
/) or a colon (:), followed by the resource name itself. Some services allows paths for resource names, as described in Paths in ARNs.
Example ARNs
The following sections provide syntax and examples of the ARNs for different services. For more information about using ARNs in a specific AWS service, see the documentation for that service.
Note
Some services support IAM resource-level permissions. For more information, see AWS Services That Work with IAM.
Topics
- Amazon API Gateway
- Auto Scaling
- AWS CloudFormation
- Amazon CloudSearch
- Amazon CloudWatch Logs
- AWS CodeCommit
- AWS CodeDeploy
- AWS CodePipeline
- Amazon DynamoDB
- Amazon EC2 Container Service (Amazon ECS)
- Amazon Elastic Compute Cloud (Amazon EC2)
- AWS Elastic Beanstalk
- Elastic Load Balancing
- Amazon Elastic Transcoder
- Amazon ElastiCache
- Amazon Glacier
- AWS Identity and Access Management (IAM)
- AWS Key Management Service (AWS KMS)
- AWS Lambda (Lambda)
- Amazon Machine Learning (Amazon ML)
- Amazon Redshift
- Amazon Relational Database Service (Amazon RDS)
- Amazon Route 53
- Amazon Simple Notification Service (Amazon SNS)
- Amazon Simple Queue Service (Amazon SQS)
- Amazon Simple Storage Service (Amazon S3)
- Amazon Simple Workflow Service (Amazon SWF)
- AWS Storage Gateway
- AWS Trusted Advisor
Amazon API Gateway
Syntax:
arn:aws:apigateway:region::resource-pathExamples:
arn:aws:apigateway:us-east-1::/restapis/a123456789012bc3de45678901f23a45/*arn:aws:apigateway:us-east-1::a123456789012bc3de45678901f23a45:/test/mydemoresource/*arn:aws:apigateway:*::a123456789012bc3de45678901f23a45:/*/petstorewalkthrough/petsAuto Scaling
Syntax:
arn:aws:autoscaling:region:account-id:scalingPolicy:policyid:autoScalingGroupName/groupfriendlyname:policyname/policyfriendlyname
arn:aws:autoscaling:region:account-id:autoScalingGroup:groupid:autoScalingGroupName/groupfriendlynameExample:
arn:aws:autoscaling:us-east-1:123456789012:scalingPolicy:c7a27f55-d35e-4153-b044-8ca9155fc467:autoScalingGroupName/my-test-asg1:policyName/my-scaleout-policyAWS CloudFormation
Syntax:
arn:aws:cloudformation:region:account-id:stack/stackname/additionalidentifierExamples:
arn:aws:cloudformation:us-east-1:123456789012:stack/MyProductionStack/abc9dbf0-43c2-11e3-a6e8-50fa526be49cAmazon CloudSearch
Syntax:
arn:aws:cloudsearch:region:account-id:domain/domainnameExample:
arn:aws:cloudsearch:us-east-1:123456789012:domain/imdb-moviesAmazon CloudWatch Logs
Syntax:
arn:aws:logs:region:*:*Examples:
arn:aws:logs:us-east-1:*:*
arn:aws:logs:us-east-1:account-id:*
arn:aws:logs:us-east-1:account-id:log-group:log_group_name
arn:aws:logs:us-east-1:account-id:log-group:log_group_name:*
arn:aws:logs:us-east-1:account-id:log-group:log_group_name_prefix*
arn:aws:logs:us-east-1:account-id:log-group:log_group_name:log-stream:log_stream_name
arn:aws:logs:us-east-1:account-id:log-group:log_group_name:log-stream:log_stream_name_prefix*
arn:aws:logs:us-east-1:account-id:log-group:log_group_name_prefix*:log-stream:log_stream_name_prefix*AWS CodeCommit
Syntax:
arn:aws:codecommit:region:account-id:/resourceExample:
arn:aws:codecommit:us-east-1:123456789012:MyDemoRepoAWS CodeDeploy
Syntax:
arn:aws:codedeploy:region:account-id:resource-type:resource-specifier
arn:aws:codedeploy:region:account-id:resource-type/resource-specifierExample:
arn:aws:codedeploy:us-east-1:123456789012:application:WordPress_App
arn:aws:codedeploy:us-east-1:123456789012:instance/AssetTag*AWS CodePipeline
Syntax:
arn:aws:codepipeline:region:account-id:resource-type:resource-specifierExample:
arn:aws:codepipeline:us-east-1:123456789012:MyDemoPipelineAmazon DynamoDB
Syntax:
arn:aws:dynamodb:region:account-id:table/tablenameExample:
arn:aws:dynamodb:us-east-1:123456789012:table/books_tableAmazon EC2 Container Service (Amazon ECS)
Syntax:
arn:aws:ecs:region:account-id:cluster/cluster-name
arn:aws:ecs:region:account-id:container-instance/container-instance-id
arn:aws:ecs:region:account-id:task-definition/task-definition-family-name:task-definition-revision-number
arn:aws:ecs:region:account-id:service/service-name
arn:aws:ecs:region:account-id:task/task-id
arn:aws:ecs:region:account-id:container/container-idExamples:
arn:aws:ecs:us-east-1:123456789012:cluster/my-cluster
arn:aws:ecs:us-east-1:123456789012:container-instance/403125b0-555c-4473-86b5-65982db28a6d
arn:aws:ecs:us-east-1:123456789012:task-definition/hello_world:8
arn:aws:ecs:us-east-1:123456789012:service/sample-webapp
arn:aws:ecs:us-east-1:123456789012:task/1abf0f6d-a411-4033-b8eb-a4eed3ad252a
arn:aws:ecs:us-east-1:123456789012:container/476e7c41-17f2-4c17-9d14-412566202c8aAmazon Elastic Compute Cloud (Amazon EC2)
Syntax:
arn:aws:ec2:region:account-id:customer-gateway/cgw-id
arn:aws:ec2:region:account-id:dhcp-options/dhcp-options-id
arn:aws:ec2:region::image/image-id
arn:aws:ec2:region:account-id:instance/instance-id
arn:aws:iam::account:instance-profile/instance-profile-name
arn:aws:ec2:region:account-id:internet-gateway/igw-id
arn:aws:ec2:region:account-id:key-pair/key-pair-name
arn:aws:ec2:region:account-id:network-acl/nacl-id
arn:aws:ec2:region:account-id:network-interface/eni-id
arn:aws:ec2:region:account-id:placement-group/placement-group-name
arn:aws:ec2:region:account-id:route-table/route-table-id
arn:aws:ec2:region:account-id:security-group/security-group-id
arn:aws:ec2:region::snapshot/snapshot-id
arn:aws:ec2:region:account-id:subnet/subnet-id
arn:aws:ec2:region:account-id:volume/volume-id
arn:aws:ec2:region:account-id:vpc/vpc-id
arn:aws:ec2:region:account-id:vpc-peering-connection/vpc-peering-connection-idExamples:
arn:aws:ec2:us-east-1::image/ami-1a2b3c4d
arn:aws:ec2:us-east-1:123456789012:instance/*
arn:aws:ec2:us-east-1:123456789012:volume/*
arn:aws:ec2:us-east-1:123456789012:volume/vol-1a2b3c4dAWS Elastic Beanstalk
Syntax:
arn:aws:elasticbeanstalk:region:account-id:application/applicationname
arn:aws:elasticbeanstalk:region:account-id:applicationversion/applicationname/versionlabel
arn:aws:elasticbeanstalk:region:account-id:environment/applicationname/environmentname
arn:aws:elasticbeanstalk:region::solutionstack/solutionstackname
arn:aws:elasticbeanstalk:region:account-id:template/applicationname/templatenameExamples:
arn:aws:elasticbeanstalk:us-east-1:123456789012:application/My App
arn:aws:elasticbeanstalk:us-east-1:123456789012:applicationversion/My App/My Version
arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment
arn:aws:elasticbeanstalk:us-east-1::solutionstack/32bit Amazon Linux running Tomcat 7
arn:aws:elasticbeanstalk:us-east-1:123456789012:template/My App/My TemplateElastic Load Balancing
Syntax:
arn:aws:elasticloadbalancing:region:account-id:loadbalancer/loadbalancernameExample:
arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/myloadbalancerAmazon Elastic Transcoder
Syntax:
arn:aws:elastictranscoder:region:account-id:resource/idExample:
arn:aws:elastictranscoder:us-east-1:123456789012:preset/*Amazon ElastiCache
Syntax:
arn:aws:elasticache:region:account-id:resourcetype:resourcenameExamples:
arn:aws:elasticache:us-west-2:123456789012:cluster:myCluster
arn:aws:elasticache:us-west-2:123456789012:snapshot:mySnapshotAmazon Glacier
Syntax:
arn:aws:glacier:region:account-id:vaults/vaultnameExamples:
arn:aws:glacier:us-east-1:123456789012:vaults/examplevault
arn:aws:glacier:us-east-1:123456789012:vaults/example*
arn:aws:glacier:us-east-1:123456789012:vaults/*AWS Identity and Access Management (IAM)
Syntax:
arn:aws:iam::account-id:root
arn:aws:iam::account-id:user/user-name
arn:aws:iam::account-id:group/group-name
arn:aws:iam::account-id:role/role-name
arn:aws:iam::account-id:policy/policy-name
arn:aws:iam::account-id:instance-profile/instance-profile-name
arn:aws:sts::account-id:federated-user/user-name
arn:aws:sts::account-id:assumed-role/role-name/role-session-name
arn:aws:iam::account-id:mfa/virtual-device-name
arn:aws:iam::account-id:server-certificate/certificate-nameExamples:
arn:aws:iam::123456789012:root
arn:aws:iam::123456789012:user/Bob
arn:aws:iam::123456789012:user/division_abc/subdivision_xyz/Bob
arn:aws:iam::123456789012:group/Developers
arn:aws:iam::123456789012:group/division_abc/subdivision_xyz/product_A/Developers
arn:aws:iam::123456789012:role/S3Access
arn:aws:iam::123456789012:role/application_abc/component_xyz/S3Access
arn:aws:iam::123456789012:policy/UsersManageOwnCredentials
arn:aws:iam::123456789012:policy/division_abc/subdivision_xyz/UsersManageOwnCredentials
arn:aws:iam::123456789012:instance-profile/Webserver
arn:aws:sts::123456789012:federated-user/Bob
arn:aws:sts::123456789012:assumed-role/Accounting-Role/Mary
arn:aws:iam::123456789012:mfa/BobJonesMFA
arn:aws:iam::123456789012:server-certificate/ProdServerCert
arn:aws:iam::123456789012:server-certificate/division_abc/subdivision_xyz/ProdServerCertFor more information about IAM ARNs, see IAM ARNs in IAM User Guide.
AWS Key Management Service (AWS KMS)
Syntax:
arn:aws:kms:region:account-id:key/key-idarn:aws:kms:region:account-id:alias/aliasExamples:
arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012arn:aws:kms:us-west-2:123456789012:alias/example-aliasAWS Lambda (Lambda)
Syntax:
arn:aws:lambda:region:account-id:function:function-nameExample:
arn:aws:lambda:us-east-1:123456789012:function:ProcessKinesisRecordsAmazon Machine Learning (Amazon ML)
Syntax:
arn:aws:machinelearning:region:account-id:datasource/datasourceID
arn:aws:machinelearning:region:account-id:mlmodel/mlmodelID
arn:aws:machinelearning:region:account-id:batchprediction/batchpredictionlID
arn:aws:machinelearning:region:account-id:evaluation/evaluationIDExamples:
arn:aws:machinelearning:us-west-2:123456789012:datasource/my-datasource-1
arn:aws:machinelearning:us-west-2:123456789012:mlmodel/my-mlmodel
arn:aws:machinelearning:us-west-2:123456789012:batchprediction/my-batchprediction
arn:aws:machinelearning:us-west-2:123456789012:evaluation/my-evaluationAmazon Redshift
Syntax:
arn:aws:redshift:region:account-id:cluster:clustername
arn:aws:redshift:region:account-id:parametergroup:parametergroupname
arn:aws:redshift:region:account-id:securitygroup:securitygroupname
arn:aws:redshift:region:account-id:snapshot:clustername/snapshotname
arn:aws:redshift:region:account-id:subnetgroup:subnetgroupnameExamples:
arn:aws:redshift:us-east-1:123456789012:cluster:my-cluster
arn:aws:redshift:us-east-1:123456789012:parametergroup:my-parameter-group
arn:aws:redshift:us-east-1:123456789012:securitygroup:my-public-group
arn:aws:redshift:us-east-1:123456789012:snapshot:my-cluster/my-snapshot20130807
arn:aws:redshift:us-east-1:123456789012:subnetgroup:my-subnet-10
Amazon Relational Database Service (Amazon RDS)
ARNs are used in Amazon RDS only with tags for DB instances. For more information, see Tagging a DB Instance in the Amazon Relational Database Service User Guide.
Syntax:
arn:aws:service:region:account-id:db:databasename
arn:aws:service:region:account-id:snapshot:snapshotnameExamples:
arn:aws:rds:eu-west-1:123456789012:db:mysql-db
arn:aws:rds:us-east-1:123456789012:snapshot:my-snapshot2Amazon Route 53
Syntax:
arn:aws:route53:::hostedzone/zoneid
arn:aws:route53:::change/changeidNote that Amazon Route 53 does not require an account number or region in ARNs.
Examples:
arn:aws:route53:::hostedzone/Z148QEXAMPLE8V
arn:aws:route53:::change/C2RDJ5EXAMPLE2
arn:aws:route53:::change/*Amazon Simple Notification Service (Amazon SNS)
Syntax:
arn:aws:sns:region:account-id:topicname
arn:aws:sns:region:account-id:topicname:subscriptionid
Examples:
arn:aws:sns:*:123456789012:my_corporate_topic
arn:aws:sns:us-east-1:123456789012:my_corporate_topic:02034b43-fefa-4e07-a5eb-3be56f8c54ceAmazon Simple Queue Service (Amazon SQS)
Syntax:
arn:aws:sqs:region:account-id:queuenameExample:
arn:aws:sqs:us-east-1:123456789012:queue1Amazon Simple Storage Service (Amazon S3)
Syntax:
arn:aws:s3:::bucketname
arn:aws:s3:::bucketname/objectpathNote that Amazon S3 does not require an account number or region in ARNs.
Examples:
arn:aws:s3:::my_corporate_bucket
arn:aws:s3:::my_corporate_bucket/*
arn:aws:s3:::my_corporate_bucket/Development/*Amazon Simple Workflow Service (Amazon SWF)
Syntax:
arn:aws:swf:region:account-id:/domain/domain_nameExamples:
arn:aws:swf:us-east-1:123456789012:/domain/department1
arn:aws:swf:*:123456789012:/domain/*AWS Storage Gateway
Syntax:
arn:aws:storagegateway:region:account-id:gateway/gatewayname
arn:aws:storagegateway:region:account-id:gateway/gatewayname/volume/volumename
arn:aws:storagegateway:us-east-1:123456789012:gateway/gatewayname/target/targetnameExamples:
arn:aws:storagegateway:us-east-1:123456789012:gateway/mygateway
arn:aws:storagegateway:us-east-1:123456789012:gateway/mygateway/volume/*
arn:aws:storagegateway:us-east-1:123456789012:gateway/mygateway/volume/vol-1122AABB
arn:aws:storagegateway:us-east-1:123456789012:gateway/mygateway/target/iqn.1997-05.com.amazon:myvolumeAWS Trusted Advisor
Syntax:
arn:aws:trustedadvisor:*:account-id:checks/categorycode/checkid
Example:
arn:aws:trustedadvisor:*:123456789012:checks/fault_tolerance/BueAdJ7NrPPaths in ARNs
Some services let you specify a path for the resource name. 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.
In some circumstances, paths can include a wildcard character, namely an asterisk
(*). For example, if you are writing an IAM policy and in the
Resource element you want to specify all IAM users that have the path
product_1234, you can use a wildcard like this:
arn:aws:iam::123456789012:user/Development/product_1234/*Similarly, in the Resource element of an IAM policy, at the end of the ARN
you can specify user/* to mean all users or group/* to mean all
groups, as in the following examples:
"Resource":"arn:aws:iam::123456789012:user/*"
"Resource":"arn:aws:iam::123456789012:group/*"Note
You cannot use a wildcard to specify all users in the Principal element in
a resource-based policy or a role trust policy. Groups are not supported as principals in
any policy.
The following example shows ARNs for an Amazon S3 bucket in which the resource name includes a path:
arn:aws:s3:::my_corporate_bucket/*
arn:aws:s3:::my_corporate_bucket/Development/*You cannot use a wildcard in the portion of the ARN that specifies the resource type, such
as the term user in an IAM ARN. The following is not allowed:
arn:aws:iam::123456789012:u*AWS Service Namespaces
When you create AWS IAM policies or work with Amazon Resource Names (ARNs), you identify
an AWS service using a namespace. For example, the namespace for Amazon S3 is
s3, and the namespace for Amazon EC2 is ec2. You use namespaces when
identifying actions and resources.
The following example shows an IAM policy where the value of the
Action elements and the values in the Resource and
Condition elements use namespaces to identify the services for the
actions and resources.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": [
"arn:aws:ec2:us-west-2:123456789012:customer-gateway/*",
"arn:aws:ec2:us-west-2:123456789012:dhcp-options/*",
"arn:aws:ec2:us-west-2::image/*",
"arn:aws:ec2:us-west-2:123456789012:instance/*",
"arn:aws:iam::123456789012:instance-profile/*",
"arn:aws:ec2:us-west-2:123456789012:internet-gateway/*",
"arn:aws:ec2:us-west-2:123456789012:key-pair/*",
"arn:aws:ec2:us-west-2:123456789012:network-acl/*",
"arn:aws:ec2:us-west-2:123456789012:network-interface/*",
"arn:aws:ec2:us-west-2:123456789012:placement-group/*",
"arn:aws:ec2:us-west-2:123456789012:route-table/*",
"arn:aws:ec2:us-west-2:123456789012:security-group/*",
"arn:aws:ec2:us-west-2::snapshot/*",
"arn:aws:ec2:us-west-2:123456789012:subnet/*",
"arn:aws:ec2:us-west-2:123456789012:volume/*",
"arn:aws:ec2:us-west-2:123456789012:vpc/*",
"arn:aws:ec2:us-west-2:123456789012:vpc-peering-connection/*"
]
},
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "arn:aws:s3:::example_bucket/marketing/*"
},
{
"Effect": "Allow",
"Action": "s3:ListBucket*",
"Resource": "arn:aws:s3:::example_bucket",
"Condition": {"StringLike": {"s3:prefix": "marketing/*"}}
}
]
}The following table lists the AWS service namespaces.
| Service | Namespace |
|---|---|
| Amazon API Gateway | apigateway |
| Amazon AppStream | appstream |
| Auto Scaling | autoscaling |
| AWS Billing and Cost Management | aws-portal |
| AWS CloudFormation | cloudformation |
| Amazon CloudFront | cloudfront |
| Amazon CloudSearch | cloudsearch |
| AWS CloudTrail | cloudtrail |
| CloudWatch | cloudwatch |
| AWS CodeCommit | codecommit |
| AWS CodeDeploy | codedeploy |
| AWS CodePipeline | codepipeline |
| AWS Config | config |
| Amazon Cognito | cognito-identity |
| Amazon Cognito Sync | cognito-sync |
| AWS Data Pipeline | datapipeline |
| AWS Device Farm | devicefarm |
| AWS Direct Connect | directconnect |
| AWS Directory Service | ds |
| DynamoDB | dynamodb |
| Amazon EC2 | ec2 |
| Elastic Beanstalk | elasticbeanstalk |
| Elastic Load Balancing | elasticloadbalancing |
| Amazon Elastic MapReduce | elasticmapreduce |
| Amazon ElastiCache | elasticache |
| Amazon Elastic Transcoder | elastictranscoder |
| Amazon Glacier | glacier |
| AWS Identity and Access Management | iam |
| AWS Import/Export | importexport |
| AWS Key Management Service | kms |
| Amazon Kinesis | kinesis |
| AWS Lambda | lambda |
| Amazon Machine Learning | machinelearning |
| AWS Marketplace | aws-marketplace |
| AWS Marketplace Management Portal | aws-marketplace-management |
| Amazon Mobile Analytics | mobileanalytics |
| AWS OpsWorks | opsworks |
| Amazon RDS | rds |
| Amazon Redshift | redshift |
| Amazon Route 53 | route53 |
| Amazon S3 | s3 |
| AWS Service Catalog | servicecatalog |
| Amazon SES | ses |
| Amazon SimpleDB | sdb |
| Amazon SNS | sns |
| Amazon SQS | sqs |
| AWS Storage Gateway | storagegateway |
| AWS STS | sts |
| AWS Support | support |
| Amazon SWF | swf |
| AWS Trusted Advisor | trustedadvisor |
| Amazon VPC | ec2 |
| Amazon WorkSpaces | workspaces |


