aws

package
v3.11.7 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package aws contains functions which wrap various Amazon Web Services APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

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 DummEC2MetadataProvider added in v3.11.0

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

func (DummEC2MetadataProvider) GetDynamicData added in v3.11.0

func (d DummEC2MetadataProvider) GetDynamicData(p string) (string, error)

func (DummEC2MetadataProvider) GetMetadata added in v3.11.0

func (d DummEC2MetadataProvider) GetMetadata(p string) (string, error)

func (DummEC2MetadataProvider) Region added in v3.11.0

func (d DummEC2MetadataProvider) Region() (string, error)

type DummyInstanceDescriber

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

DummyInstanceDescriber - test doubles

func (DummyInstanceDescriber) DescribeInstances

DescribeInstances -

type EC2Metadata added in v3.11.0

type EC2Metadata interface {
	GetMetadata(p string) (string, error)
	GetDynamicData(p string) (string, error)
	Region() (string, error)
}

type Ec2Info

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

Ec2Info -

func NewDummyEc2Info

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 -

func (*Ec2Info) Tags added in v3.8.0

func (e *Ec2Info) Tags() (map[string]string, error)

type Ec2Meta

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

Ec2Meta -

func MockEC2Meta added in v3.11.0

func MockEC2Meta(data map[string]string, dynamicData map[string]string, region string) *Ec2Meta

MockEC2Meta -

func NewDummyEc2Meta

func NewDummyEc2Meta() *Ec2Meta

NewDummyEc2Meta -

func NewEc2Meta

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 KMS

type KMS struct {
	Client KMSAPI
}

KMS is an AWS KMS client

func NewKMS

func NewKMS(_ 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(_ 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