aws

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("not found")
)

Functions

func InGithubAction

func InGithubAction() bool

func LambdaLogGroup

func LambdaLogGroup(lambdaName string) string

func TestProfile

func TestProfile() string

Types

type AWS

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

func New

func New() (*AWS, error)

func NewForTests

func NewForTests(t testingI) *AWS

NewForTests creates new client for use in tests environment variable with aws profile must be declare testingI is here to brake dependency on testing package Usage:

 func TestMy(t *testing.T) {
 	cli := NewForTests(t)
 	if cli == nil {
			t.Skip("skip: cli not initialized")
  	}

Run tests:

MANTIL_TESTS_AWS_PROFILE=org5 go test -v

func NewFromProfile

func NewFromProfile(profile string) (*AWS, error)

func NewWithCredentials

func NewWithCredentials(accessKeyID, secretAccessKey, sessionToken, region string) (*AWS, error)

func NewWithEndpointCredentials

func NewWithEndpointCredentials(endpoint, region string, token func() string) (*AWS, error)

func (*AWS) APIGAtewayCloudwatchRole

func (a *AWS) APIGAtewayCloudwatchRole() (string, error)

func (*AWS) AccountID

func (a *AWS) AccountID() string

func (*AWS) CloudFormation

func (a *AWS) CloudFormation() *CloudFormation

func (*AWS) CreateRole

func (a *AWS) CreateRole(name, assumeRolePolicy, policy string) (string, error)

func (*AWS) Credentials

func (a *AWS) Credentials() (aws.Credentials, error)

func (*AWS) DeleteDynamodbTablesByTags

func (a *AWS) DeleteDynamodbTablesByTags(tags []TagFilter) error

func (*AWS) FetchLogs

func (a *AWS) FetchLogs(group string, filter string, start *int64) (chan LogEvent, error)

func (*AWS) GetResourcesByTypeAndTag

func (a *AWS) GetResourcesByTypeAndTag(resourceTypes []string, resourceTags []TagFilter) ([]string, error)

func (*AWS) GetSSMParameter added in v0.2.9

func (a *AWS) GetSSMParameter(path string) (string, error)

func (*AWS) InvokeLambdaFunction

func (a *AWS) InvokeLambdaFunction(name string, req, rsp, clientContext interface{}) error

func (*AWS) Lambda

func (a *AWS) Lambda() *Lambda

func (*AWS) LambdaExists

func (a *AWS) LambdaExists(name string) (bool, error)

func (*AWS) PublishToAPIGatewayConnection

func (a *AWS) PublishToAPIGatewayConnection(domain, stage, connectionID string, data []byte) error

func (*AWS) Region

func (a *AWS) Region() string

func (*AWS) Role

func (a *AWS) Role(name string) (string, error)

func (*AWS) RoleCredentials

func (a *AWS) RoleCredentials(name, role, policy string, durationSeconds int32) (*Credentials, error)

func (*AWS) RoleExists

func (a *AWS) RoleExists(name string) (bool, error)

func (*AWS) S3

func (a *AWS) S3() *S3

func (*AWS) SetAPIGatewayCloudwatchRole

func (a *AWS) SetAPIGatewayCloudwatchRole(arn string) error

func (*AWS) TagLogGroup

func (a *AWS) TagLogGroup(name string, tags map[string]string) error

func (*AWS) Try

func (a *AWS) Try() error

Try will return error if can't get AWS account id

func (*AWS) UpdateLambdaFunctionCodeFromS3

func (a *AWS) UpdateLambdaFunctionCodeFromS3(function, bucket, key string) error

func (*AWS) WaitLambdaFunctionUpdated

func (a *AWS) WaitLambdaFunctionUpdated(function string) error

type CloudFormation

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

func (*CloudFormation) CreateStack

func (f *CloudFormation) CreateStack(name, templateBody string, resourceTags map[string]string) *StackWaiter

func (*CloudFormation) DeleteStack

func (f *CloudFormation) DeleteStack(name string) *StackWaiter

func (*CloudFormation) UpdateStack

func (f *CloudFormation) UpdateStack(name, templateBody string, resourceTags map[string]string) (*StackWaiter, error)

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	Expiration      *time.Time
}

type Lambda

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

func (*Lambda) Info

func (l *Lambda) Info(name string) (map[string]string, error)

func (*Lambda) Invoke

func (l *Lambda) Invoke(name string, req, rsp interface{}, headers map[string]string) error

func (*Lambda) SetMemory

func (l *Lambda) SetMemory(name string, mem int) error

type LogEvent

type LogEvent struct {
	Message   string
	Timestamp int64
}

type RoleNotExistsError

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

func (*RoleNotExistsError) Error

func (a *RoleNotExistsError) Error() string

type S3

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

func (*S3) CreateBucket

func (a *S3) CreateBucket(bucket string, tags map[string]string) error

func (*S3) DeleteBucket

func (a *S3) DeleteBucket(name string) error

func (*S3) DeleteBucketPrefix

func (a *S3) DeleteBucketPrefix(name, prefix string) error

func (*S3) DeleteBucketsByTags

func (s *S3) DeleteBucketsByTags(tags []TagFilter) error

func (*S3) Put

func (a *S3) Put(bucket, key string, buf []byte) error

func (*S3) PutLifecycleRuleForPrefixExpire

func (a *S3) PutLifecycleRuleForPrefixExpire(name, prefix string, days int) error

type StackWaiter

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

func (*StackWaiter) Events

func (w *StackWaiter) Events() <-chan types.StackEvent

func (*StackWaiter) Wait

func (w *StackWaiter) Wait() error

type TagFilter

type TagFilter struct {
	Key    string
	Values []string
}

Jump to

Keyboard shortcuts

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