AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ARN

import "github.com/aws/aws-sdk-go/aws/arn"

type ARN struct { Partition string Service string Region string AccountID string Resource string }

ARN captures the individual fields of an Amazon Resource Name. See https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html for more information.

Partition

Type: string

The partition that the resource is in. For standard AWS regions, the partition is "aws". If you have resources in other partitions, the partition is "aws-partitionname". For example, the partition for resources in the China (Beijing) region is "aws-cn".

Service

Type: string

The service namespace that identifies the AWS product (for example, Amazon S3, IAM, or Amazon RDS). For a list of namespaces, see https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces.

Region

Type: string

The region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.

AccountID

Type: string

The 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

Type: string

The 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 https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-paths.

Method

String

func (arn ARN) String() string

String returns the canonical representation of the ARN

On this page: