aws

package
v0.0.0-...-0df1b2a Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(maxRetries int, maxRetryInterval time.Duration) *aws.Config

Config sets up configuration for AWS session

func NewClampedRetryer

func NewClampedRetryer(maxRetries int, maxRetryInterval time.Duration) request.Retryer

func Session

func Session(config *aws.Config, assumedRole string) (*session.Session, error)

Session sets up an AWS session with the region automatically detected from the environment or the ec2 metadata service if running on ec2.

Types

type AssumeRoleProvider

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

AssumeRoleProvider is an AWS SDK credentials provider which retrieve credentials by assuming the defined role.

func NewAssumeRoleProvider

func NewAssumeRoleProvider(role, sessionName string, sess *session.Session) *AssumeRoleProvider

NewAssumeRoleProvider initializes a new AssumeRoleProvider.

func (*AssumeRoleProvider) IsExpired

func (a *AssumeRoleProvider) IsExpired() bool

IsExpired is true when the credentials has expired and must be retrieved again.

func (*AssumeRoleProvider) Retrieve

func (a *AssumeRoleProvider) Retrieve() (credentials.Value, error)

Retrieve retrieves new credentials by assuming the defined role.

type Instance

type Instance struct {
	InstanceType              string
	VCPU                      int64
	Memory                    int64
	InstanceStorageDevices    int64
	InstanceStorageDeviceSize int64
	Architecture              string
}

func (Instance) AvailableStorage

func (i Instance) AvailableStorage(instanceStorageScaleFactor float64, rootVolumeSize int64, rootVolumeScaleFactor float64) int64

func (Instance) MemoryFraction

func (i Instance) MemoryFraction(percent int64) int64

type InstanceTypes

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

func NewInstanceTypes

func NewInstanceTypes(instanceData []Instance) *InstanceTypes

func NewInstanceTypesFromAWS

func NewInstanceTypesFromAWS(ec2client ec2iface.EC2API) (*InstanceTypes, error)

func (*InstanceTypes) AllInstances

func (types *InstanceTypes) AllInstances() map[string]Instance

AllInstances returns information for all known AWS EC2 instances.

func (*InstanceTypes) InstanceInfo

func (types *InstanceTypes) InstanceInfo(instanceType string) (Instance, error)

func (*InstanceTypes) SyntheticInstanceInfo

func (types *InstanceTypes) SyntheticInstanceInfo(instanceTypes []string) (Instance, error)

Jump to

Keyboard shortcuts

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