utils

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package utils provides common utility functions used across the methodaws codebase.

Package utils provides common utility functions used across the methodaws codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSDNSSuffixForRegion added in v0.3.0

func AWSDNSSuffixForRegion(region string) (string, error)

AWSDNSSuffixForRegion returns the service endpoint suffix for the partition that owns region.

func BuildGlobalARNForRegion added in v0.3.0

func BuildGlobalARNForRegion(region, service, accountID, resource string) (string, error)

BuildGlobalARNForRegion builds a global-resource ARN in the partition that owns region.

func BuildRegionalARN added in v0.3.0

func BuildRegionalARN(region, service, accountID, resource string) (string, error)

BuildRegionalARN builds an ARN using the AWS partition that owns region.

func BuildRelatedARN added in v0.3.0

func BuildRelatedARN(sourceARN, service, region, resource string) (string, error)

BuildRelatedARN builds an ARN using the partition and account from an authoritative source ARN.

func GetAWSRegions added in v0.0.49

func GetAWSRegions(ctx context.Context, cfg aws.Config, selectedRegions []string) ([]string, error)

func GetAccountID added in v0.0.47

func GetAccountID(ctx context.Context, awsConfig aws.Config) (string, error)

GetAccountID retrieves the account ID for the given AWS configuration. It returns the account ID as a string and an error if the account ID cannot be retrieved.

func IsCommercialAWSRegion added in v0.3.0

func IsCommercialAWSRegion(region string) (bool, error)

IsCommercialAWSRegion reports whether region belongs to the standard commercial AWS partition.

func NormalizeSelectedRegions added in v0.3.1

func NormalizeSelectedRegions(selectedRegions []string) ([]string, error)

NormalizeSelectedRegions validates region syntax and partition, and removes duplicates without AWS API calls.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL