awsutil

package
v0.0.0-...-785145d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvVarAWSRegion is an environment variable.
	EnvVarAWSRegion = "AWS_REGION_NAME"
	// DefaultRegion a default.
	DefaultRegion = "us-east-1"
)

Variables

This section is empty.

Functions

func MustNewSession

func MustNewSession(cfg Config) *session.Session

MustNewSession returns a new session and panics on error.

func NewSession

func NewSession(cfg Config) (*session.Session, error)

NewSession creates a new aws session from a config.

Types

type Config

type Config struct {
	Region          string `json:"region,omitempty" yaml:"region,omitempty" env:"AWS_REGION_NAME"`
	AccessKeyID     string `json:"accessKeyID,omitempty" yaml:"accessKeyID,omitempty" env:"AWS_ACCESS_KEY_ID"`
	SecretAccessKey string `json:"secretAccessKey,omitempty" yaml:"secretAccessKey,omitempty" env:"AWS_SECRET_ACCESS_KEY"`
	Token           string `json:"token,omitempty" yaml:"token,omitempty" env:"AWS_SECURITY_TOKEN"`
}

Config is a config object.

func (Config) IsZero

func (a Config) IsZero() bool

IsZero returns if the aws config is set.

func (Config) RegionOrDefault

func (a Config) RegionOrDefault() string

RegionOrDefault gets a property or a default.

func (*Config) Resolve

func (a *Config) Resolve(ctx context.Context) error

Resolve implements configutil.Resolver.

Jump to

Keyboard shortcuts

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