aws

package
v3.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package aws contains functions which wrap various Amazon Web Services APIs

Index

Constants

This section is empty.

Variables

View Source
var DefaultEndpoint = "http://169.254.169.254"

DefaultEndpoint -

Functions

func MockHTTPServer

func MockHTTPServer(code int, body string) (*httptest.Server, *http.Client)

MockHTTPServer -

func SDKSession

func SDKSession(region ...string) *session.Session

SDKSession -

Types

type CallerIdentitifier

type CallerIdentitifier interface {
	GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)
}

CallerIdentitifier - an interface to wrap GetCallerIdentity

type ClientOptions added in v1.9.1

type ClientOptions struct {
	Timeout time.Duration
}

ClientOptions -

func GetClientOptions

func GetClientOptions() ClientOptions

GetClientOptions - Centralised reading of AWS_TIMEOUT ... but cannot use in vault/auth.go as different strconv.Atoi error handling

type DummyInstanceDescriber added in v1.8.0

type DummyInstanceDescriber struct {
	// contains filtered or unexported fields
}

DummyInstanceDescriber - test doubles

func (DummyInstanceDescriber) DescribeInstances added in v1.8.0

DescribeInstances -

type Ec2Info

type Ec2Info struct {
	// contains filtered or unexported fields
}

Ec2Info -

func NewDummyEc2Info added in v1.8.0

func NewDummyEc2Info(metaClient *Ec2Meta) *Ec2Info

NewDummyEc2Info -

func NewEc2Info

func NewEc2Info(options ClientOptions) (info *Ec2Info)

NewEc2Info -

func (*Ec2Info) Tag

func (e *Ec2Info) Tag(tag string, def ...string) (string, error)

Tag -

type Ec2Meta

type Ec2Meta struct {
	Endpoint string
	Client   *http.Client
	// contains filtered or unexported fields
}

Ec2Meta -

func MockServer

func MockServer(code int, body string) (*httptest.Server, *Ec2Meta)

MockServer -

func NewDummyEc2Meta added in v1.8.0

func NewDummyEc2Meta() *Ec2Meta

NewDummyEc2Meta -

func NewEc2Meta added in v1.1.1

func NewEc2Meta(options ClientOptions) *Ec2Meta

NewEc2Meta -

func (*Ec2Meta) Dynamic

func (e *Ec2Meta) Dynamic(key string, def ...string) (string, error)

Dynamic -

func (*Ec2Meta) Meta

func (e *Ec2Meta) Meta(key string, def ...string) (string, error)

Meta -

func (*Ec2Meta) Region

func (e *Ec2Meta) Region(def ...string) (string, error)

Region -

type InstanceDescriber

type InstanceDescriber interface {
	DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
}

InstanceDescriber - A subset of ec2iface.EC2API that we can use to call EC2.DescribeInstances

type InstanceDocument

type InstanceDocument struct {
	PrivateIP        string `json:"privateIp"`
	AvailabilityZone string `json:"availabilityZone"`
	InstanceID       string `json:"InstanceId"`
	InstanceType     string `json:"InstanceType"`
	AccountID        string `json:"AccountId"`
	ImageID          string `json:"imageId"`
	Architecture     string `json:"architecture"`
	Region           string `json:"region"`
}

InstanceDocument -

type KMS

type KMS struct {
	Client KMSAPI
}

KMS is an AWS KMS client

func NewKMS

func NewKMS(option ClientOptions) *KMS

NewKMS - Create new AWS KMS client using an SDKSession

func (*KMS) Decrypt

func (k *KMS) Decrypt(ciphertext string) (string, error)

Decrypt a base64 encoded ciphertext

func (*KMS) Encrypt

func (k *KMS) Encrypt(keyID, plaintext string) (string, error)

Encrypt plaintext using the specified key. Returns a base64 encoded ciphertext

type KMSAPI

type KMSAPI interface {
	Encrypt(input *kms.EncryptInput) (*kms.EncryptOutput, error)
	Decrypt(input *kms.DecryptInput) (*kms.DecryptOutput, error)
}

KMSAPI is a subset of kmsiface.KMSAPI

type STS

type STS struct {
	// contains filtered or unexported fields
}

STS -

func NewSTS

func NewSTS(options ClientOptions) *STS

NewSTS -

func (*STS) Account

func (s *STS) Account() (string, error)

Account -

func (*STS) Arn

func (s *STS) Arn() (string, error)

Arn -

func (*STS) UserID

func (s *STS) UserID() (string, error)

UserID -

Jump to

Keyboard shortcuts

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