Documentation
¶
Overview ¶
Package arn provides utilities for building AWS ARNs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build constructs an AWS ARN from the given components. For IAM (service == "iam"), the region is omitted as IAM is a global service. The partition is derived from the region so GovCloud, China, and ISO regions produce wire-correct ARNs. Format: arn:{partition}:{service}:{region}:{accountID}:{resource}.
func BuildS3 ¶
BuildS3 constructs an ARN for an S3 resource. S3 ARNs have no region or account ID component. Format: arn:aws:s3:::{resource}.
func PartitionForRegion ¶
PartitionForRegion returns the AWS partition (e.g. "aws", "aws-us-gov", "aws-cn", "aws-iso", "aws-iso-b") for the given region. Empty or unknown regions resolve to the standard "aws" partition.
Real AWS resources living in GovCloud or China use distinct ARN partitions and clients reject cross-partition ARNs. Use this helper when constructing ARNs from a region whose partition is not known a priori.
Types ¶
This section is empty.