aws

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package aws contains helpers for working with the aws api, namely configuration and session management. It also includes sub packages for working with common apis like ses and s3.

Index

Constants

View Source
const (
	// DefaultAWSRegion is a default.
	DefaultAWSRegion = "us-east-1"
)

Variables

This section is empty.

Functions

func MustNewSession

func MustNewSession(cfg *Config) *session.Session

MustNewSession creates a new aws session from a config 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"`
	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"`
	SecurityToken   string `json:"securityToken,omitempty" yaml:"securityToken,omitempty" env:"AWS_SECURITY_TOKEN"`
}

Config is a config object.

func MustNewConfigFromEnv

func MustNewConfigFromEnv() *Config

MustNewConfigFromEnv returns a new config from the environment and panics on error.

func NewConfigFromEnv

func NewConfigFromEnv() (*Config, error)

NewConfigFromEnv returns a new aws config from the environment.

func (Config) GetAccessKeyID

func (a Config) GetAccessKeyID(defaults ...string) string

GetAccessKeyID gets a property or a default.

func (Config) GetRegion

func (a Config) GetRegion(defaults ...string) string

GetRegion gets a property or a default.

func (Config) GetSecretAccessKey

func (a Config) GetSecretAccessKey(defaults ...string) string

GetSecretAccessKey gets a property or a default.

func (Config) GetToken

func (a Config) GetToken(defaults ...string) string

GetToken returns a secret access token or a default.

func (Config) IsZero

func (a Config) IsZero() bool

IsZero returns if the config is unset or not.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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