Documentation ¶
Index ¶
- Constants
- func CassandraEndpointRegion(endpoint string) (string, error)
- func CassandraEndpointURLForRegion(region string) string
- func GetPartitionFromRegion(region string) string
- func IsAWSEndpoint(uri string) bool
- func IsCNRegion(region string) bool
- func IsElastiCacheEndpoint(uri string) bool
- func IsKeyspacesEndpoint(uri string) bool
- func IsMemoryDBEndpoint(uri string) bool
- func IsRDSEndpoint(uri string) bool
- func IsRedshiftEndpoint(uri string) bool
- func IsRedshiftServerlessEndpoint(uri string) bool
- func IsUSGovRegion(region string) bool
- func ParseRedshiftEndpoint(endpoint string) (clusterID, region string, err error)
- func ShortRegionToRegion(shortRegion string) (string, bool)
- type RDSEndpointDetails
- type RedisEndpointInfo
- type RedshiftServerlessEndpointDetails
Constants ¶
const ( // ElastiCacheConfigurationEndpoint is the configuration endpoint that used // for cluster mode connection. ElastiCacheConfigurationEndpoint = "configuration" // ElastiCachePrimaryEndpoint is the endpoint of the primary node in the // node group. ElastiCachePrimaryEndpoint = "primary" // ElastiCacheReaderEndpoint is the endpoint of the replica nodes in the // node group. ElastiCacheReaderEndpoint = "reader" // ElastiCacheNodeEndpoint is the endpoint that used to connect to an // individual node. ElastiCacheNodeEndpoint = "node" // MemoryDBClusterEndpoint is the cluster configuration endpoint for a // MemoryDB cluster. MemoryDBClusterEndpoint = "cluster" // MemoryDBNodeEndpoint is the endpoint of an individual MemoryDB node. MemoryDBNodeEndpoint = "node" )
const ( // AWSEndpointSuffix is the endpoint suffix for AWS Standard and AWS US // GovCloud regions. // // https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints // https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/using-govcloud-endpoints.html AWSEndpointSuffix = ".amazonaws.com" // AWSCNEndpointSuffix is the endpoint suffix for AWS China regions. // // https://docs.amazonaws.cn/en_us/aws/latest/userguide/endpoints-arns.html AWSCNEndpointSuffix = ".amazonaws.com.cn" // RDSServiceName is the service name for AWS RDS. RDSServiceName = "rds" // RedshiftServiceName is the service name for AWS Redshift. RedshiftServiceName = "redshift" // RedshiftServerlessServiceName is the service name for AWS Redshift Serverless. RedshiftServerlessServiceName = "redshift-serverless" // ElastiCacheServiceName is the service name for AWS ElastiCache. ElastiCacheServiceName = "cache" // MemoryDBSServiceName is the service name for AWS MemoryDB. MemoryDBSServiceName = "memorydb" )
const ( // StandardPartition is the partition ID of the AWS Standard partition. StandardPartition = "aws" // CNPartition is the partition ID of the AWS China partition. CNPartition = "aws-cn" // USGovPartition is the partition ID of the AWS GovCloud partition. USGovPartition = "aws-us-gov" )
const ( // CNRegionPrefix is the prefix for all AWS China regions. CNRegionPrefix = "cn-" // USGovRegionPrefix is the prefix for all AWS US GovCloud regions. USGovRegionPrefix = "us-gov-" )
Variables ¶
This section is empty.
Functions ¶
func CassandraEndpointRegion ¶
CassandraEndpointRegion returns an AWS region from cassandra endpoint: where endpoint looks like cassandra.us-east-2.amazonaws.com https://docs.aws.amazon.com/keyspaces/latest/devguide/programmatic.endpoints.html
func CassandraEndpointURLForRegion ¶
CassandraEndpointURLForRegion returns a Cassandra endpoint based on the provided region. https://docs.aws.amazon.com/keyspaces/latest/devguide/programmatic.endpoints.html
func GetPartitionFromRegion ¶
GetPartitionFromRegion get aws partition from region example, region "us-east-1" corresponds to partition "aws" region "cn-north-1" corresponds to partition "aws-cn"
func IsAWSEndpoint ¶
IsAWSEndpoint returns true if the input URI is an AWS endpoint.
func IsCNRegion ¶
IsCNRegion returns true if the region is an AWS China region.
func IsElastiCacheEndpoint ¶
IsElastiCacheEndpoint returns true if the input URI is an ElastiCache endpoint.
func IsKeyspacesEndpoint ¶
IsKeyspacesEndpoint returns true if input URI is an AWS Keyspaces endpoint. https://docs.aws.amazon.com/keyspaces/latest/devguide/programmatic.endpoints.html
func IsMemoryDBEndpoint ¶
IsMemoryDBEndpoint returns true if the input URI is an MemoryDB endpoint.
func IsRDSEndpoint ¶
IsRDSEndpoint returns true if the input URI is an RDS endpoint.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Overview.Endpoints.html
func IsRedshiftEndpoint ¶
IsRedshiftEndpoint returns true if the input URI is an Redshift endpoint.
https://docs.aws.amazon.com/redshift/latest/mgmt/connecting-from-psql.html
func IsRedshiftServerlessEndpoint ¶
IsRedshiftServerlessEndpoint returns true if the input URI is an Redshift Serverless endpoint.
https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-connecting.html
func IsUSGovRegion ¶
IsUSGovRegion returns true if the region is an AWS US GovCloud region.
func ParseRedshiftEndpoint ¶
ParseRedshiftEndpoint extracts cluster ID and region from the provided Redshift endpoint.
func ShortRegionToRegion ¶
ShortRegionToRegion converts short region codes to regular region names. For example, a short region "use1" maps to region "us-east-1".
There is no official documentation on this mapping. Here is gist of others collecting these naming schemes: https://gist.github.com/colinvh/14e4b7fb6b66c29f79d3
This function currently does not support regions in secert partitions.
Types ¶
type RDSEndpointDetails ¶
type RDSEndpointDetails struct { // InstanceID is the identifier of an RDS instance. InstanceID string // ClusterID is the identifier of an RDS Aurora cluster. ClusterID string // ClusterCustomEndpointName is the identifier of an Aurora cluster custom endpoint. ClusterCustomEndpointName string // ProxyName is the identifier of an RDS proxy. ProxyName string // ProxyCustomEndpointName is the identifier of an RDS proxy custom endpoint. ProxyCustomEndpointName string // Region is the AWS region the database resides in. Region string }
RDSEndpointDetails contains information about an RDS endpoint.
func ParseRDSEndpoint ¶
func ParseRDSEndpoint(endpoint string) (d *RDSEndpointDetails, err error)
ParseRDSEndpoint extracts the identifier and region from the provided RDS endpoint.
func (RDSEndpointDetails) IsProxy ¶
func (d RDSEndpointDetails) IsProxy() bool
IsProxy returns true if the RDS endpoint is an RDS Proxy.
type RedisEndpointInfo ¶
type RedisEndpointInfo struct { // ID is the identifier of the endpoint. ID string // Region is the AWS region for the endpoint. Region string // TransitEncryptionEnabled specifies if in-transit encryption (TLS) is // enabled. TransitEncryptionEnabled bool // EndpointType specifies the type of the endpoint. EndpointType string }
RedisEndpointInfo describes details extracted from a ElastiCache or MemoryDB Redis endpoint.
func ParseElastiCacheEndpoint ¶
func ParseElastiCacheEndpoint(endpoint string) (*RedisEndpointInfo, error)
ParseElastiCacheEndpoint extracts the details from the provided ElastiCache Redis endpoint.
https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/GettingStarted.ConnectToCacheNode.html
func ParseMemoryDBEndpoint ¶
func ParseMemoryDBEndpoint(endpoint string) (*RedisEndpointInfo, error)
ParseMemoryDBEndpoint extracts the details from the provided MemoryDB endpoint.
https://docs.aws.amazon.com/memorydb/latest/devguide/endpoints.html
type RedshiftServerlessEndpointDetails ¶
type RedshiftServerlessEndpointDetails struct { // WorkgroupName is the name of the workgroup. WorkgroupName string // EndpointName is the name of the VPC endpoint. EndpointName string // AccountID is the AWS Account ID. AccountID string // Region is the AWS region the database resides in. Region string }
RedshiftServerlessEndpointDetails contains information about an Redshift Serverless endpoint.
func ParseRedshiftServerlessEndpoint ¶
func ParseRedshiftServerlessEndpoint(endpoint string) (details *RedshiftServerlessEndpointDetails, err error)
ParseRedshiftServerlessEndpoint extracts name, AWS Account ID, and region from the provided Redshift Serverless endpoint.