Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Expose Endpoints Partition DNSSuffix #2710

@bflad

Description

@bflad

Feature description

There does not appear to be an easy method to extract the existing endpoints.Partition DNSSuffix field for the default partitions:

DNSSuffix: "amazonaws.com",

DNSSuffix: "amazonaws.com.cn",

DNSSuffix: "amazonaws.com",

This information is helpful in building AWS partition agnostic IAM policy documents (https://docs.amazonaws.cn/en_us/aws/latest/userguide/iam.html) and constructing hostnames not available in the default endpoints information such as S3 website endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region).

Describe alternatives you've considered

Hardcoding the DNS suffix after performing a regional lookup against AWS China:

if partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), region); ok && partition.ID() == endpoints.AwsCnPartitionID {
	return fmt.Sprintf("s3-website.%s.amazonaws.com.cn", region)
}
return fmt.Sprintf("s3-website.%s.amazonaws.com", region)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions