awsutil

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package awsutil provides the common utils for AWS components

Index

Constants

View Source
const (
	STSEndpointPrefix         = "https://sts."
	STSEndpointSuffix         = ".amazonaws.com"
	STSAwsCnPartitionIDSuffix = ".amazonaws.com.cn" // AWS China partition.
)

AWS STS endpoint constants

Variables

This section is empty.

Functions

func GetAWSConfigSession

func GetAWSConfigSession(logger *zap.Logger, cn ConnAttr, cfg *AWSSessionSettings) (*aws.Config, *session.Session, error)

GetAWSConfigSession returns AWS config and session instances.

func GetDefaultSession

func GetDefaultSession(logger *zap.Logger) (*session.Session, error)

func ProxyServerTransport

func ProxyServerTransport(logger *zap.Logger, config *AWSSessionSettings) (*http.Transport, error)

ProxyServerTransport configures HTTP transport for TCP Proxy Server.

Types

type AWSSessionSettings

type AWSSessionSettings struct {
	// Maximum number of concurrent calls to AWS X-Ray to upload documents.
	NumberOfWorkers int `mapstructure:"num_workers"`
	// X-Ray service endpoint to which the collector sends segment documents.
	Endpoint string `mapstructure:"endpoint"`
	// Number of seconds before timing out a request.
	RequestTimeoutSeconds int `mapstructure:"request_timeout_seconds"`
	// Maximum number of retries before abandoning an attempt to post data.
	MaxRetries int `mapstructure:"max_retries"`
	// Enable or disable TLS certificate verification.
	NoVerifySSL bool `mapstructure:"no_verify_ssl"`
	// Upload segments to AWS X-Ray through a proxy.
	ProxyAddress string `mapstructure:"proxy_address"`
	// Send segments to AWS X-Ray service in a specific region.
	Region string `mapstructure:"region"`
	// Local mode to skip EC2 instance metadata check.
	LocalMode bool `mapstructure:"local_mode"`
	// Amazon Resource Name (ARN) of the AWS resource running the collector.
	ResourceARN string `mapstructure:"resource_arn"`
	// IAM role to upload segments to a different account.
	RoleARN string `mapstructure:"role_arn"`
}

AWSSessionSettings defines the common session configs for AWS components

func CreateDefaultSessionConfig

func CreateDefaultSessionConfig() AWSSessionSettings

type Conn

type Conn struct{}

Conn implements connAttr interface.

type ConnAttr

type ConnAttr interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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