aws

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRegion = "us-east-1"

DefaultRegion describes default region in aws

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetData

type AssetData struct {
	File io.Reader `json:"-"`
	Key  string    `json:"key"`
}

type Client

type Client interface {
	GetS3(bucket, item string) ([]byte, error)
	InvokeLambda(name string, invocationType string, request interface{}) ([]byte, error)

	CreateLambda(zipFile io.Reader, function, handler, runtime, resource string) error
	CreateOrUpdateLambda(zipFile io.Reader, function, handler, runtime, resource string) error
	MakeLambdaFunctionDefaultPolicy() (string, error)

	CreateS3Bucket(bucket string) error
	UploadS3(bucket, key string, body io.Reader) error
	ExistsS3Bucket(name string) (bool, error)

	ProvisionAppFromFile(path string, shouldUpdate bool) error
}

Client is an authenticated client for interacting with AWS resources.

func MakeClient

func MakeClient(awsAccessKeyID, awsSecretAccessKey string, logger Logger) (Client, error)

type FunctionData

type FunctionData struct {
	Bundle  io.Reader `json:"-"`
	Name    string    `json:"name"`
	Handler string    `json:"handler"`
	Runtime string    `json:"runtime"`
}

type Logger

type Logger interface {
	Error(message string, keyValuePairs ...interface{})
	Warn(message string, keyValuePairs ...interface{})
	Info(message string, keyValuePairs ...interface{})
	Debug(message string, keyValuePairs ...interface{})
}

type ProvisionData

type ProvisionData struct {
	// StaticFiles key is the name of the static file in the /static folder
	// Staticfiles value is the S3 Key where file should be provisioned
	StaticFiles map[string]AssetData `json:"static_files"`

	// LambdaFunctions key is the name of the lambda function zip bundle
	// LambdaFunctions value contains info for provisioning a function in the AWS.
	// LambdaFunctions value's Name field contains functions name in the AWS.
	LambdaFunctions map[string]FunctionData `json:"lambda_functions"`
	Manifest        *apps.Manifest          `json:"-"`
}

ProvisionData contains all the necessary data for provisioning an app

func GetProvisionDataFromFile

func GetProvisionDataFromFile(path string, log Logger) (*ProvisionData, error)

func (*ProvisionData) IsValid

func (pd *ProvisionData) IsValid() error

Jump to

Keyboard shortcuts

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