addon

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package addon contains the service to manage addons.

Package addon contains the service to manage addons.

Index

Constants

View Source
const (
	// Engine types for RDS Aurora Serverless.
	RDSEngineTypeMySQL      = "MySQL"
	RDSEngineTypePostgreSQL = "PostgreSQL"
)
View Source
const (
	// StackName is the name of the addons nested stack resource.
	StackName = "AddonsStack"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addons

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

Addons represents additional resources for a workload.

func New

func New(wlName string) (*Addons, error)

New creates an Addons object given a workload name.

func (*Addons) Template

func (a *Addons) Template() (string, error)

Template merges CloudFormation templates under the "addons/" directory of a workload into a single CloudFormation template and returns it.

If the addons directory doesn't exist, it returns the empty string and ErrAddonsDirNotExist.

type DDBAttribute

type DDBAttribute struct {
	Name     *string
	DataType *string // Must be one of "N", "S", "B"
}

DDBAttribute holds the attribute definition of a DynamoDB attribute (keys, local secondary indices).

func DDBAttributeFromKey

func DDBAttributeFromKey(input string) (DDBAttribute, error)

DDBAttributeFromKey parses the DDB type and name out of keys specified in the form "Email:S"

type DDBLocalSecondaryIndex

type DDBLocalSecondaryIndex struct {
	PartitionKey *string
	SortKey      *string
	Name         *string
}

DDBLocalSecondaryIndex holds a representation of an LSI.

type DynamoDB

type DynamoDB struct {
	DynamoDBProps
	// contains filtered or unexported fields
}

DynamoDB contains configuration options which fully describe a DynamoDB table. Implements the encoding.BinaryMarshaler interface.

func NewDynamoDB

func NewDynamoDB(input *DynamoDBProps) *DynamoDB

NewDynamoDB creates a DynamoDB cloudformation template specifying attributes, primary key schema, and local secondary index configuration.

func (*DynamoDB) MarshalBinary

func (d *DynamoDB) MarshalBinary() ([]byte, error)

MarshalBinary serializes the DynamoDB object into a binary YAML CF template. Implements the encoding.BinaryMarshaler interface.

type DynamoDBProps

type DynamoDBProps struct {
	*StorageProps
	Attributes   []DDBAttribute
	LSIs         []DDBLocalSecondaryIndex
	SortKey      *string
	PartitionKey *string
	HasLSI       bool
}

DynamoDBProps contains DynamoDB-specific properties for addon.NewDynamoDB().

func (*DynamoDBProps) BuildLocalSecondaryIndex

func (p *DynamoDBProps) BuildLocalSecondaryIndex(noLSI bool, lsiSorts []string) (bool, error)

BuildLocalSecondaryIndex generates the correct LocalSecondaryIndex property configuration based on customer input to ensure that the CF template is valid. BuildLocalSecondaryIndex should be called last, after BuildPartitionKey && BuildSortKey

func (*DynamoDBProps) BuildPartitionKey

func (p *DynamoDBProps) BuildPartitionKey(partitionKey string) error

BuildPartitionKey generates the properties required to specify the partition key based on customer inputs.

func (*DynamoDBProps) BuildSortKey

func (p *DynamoDBProps) BuildSortKey(noSort bool, sortKey string) (bool, error)

BuildSortKey generates the correct property configuration based on customer inputs.

type ErrAddonsDirNotExist added in v0.5.0

type ErrAddonsDirNotExist struct {
	WlName    string
	ParentErr error
}

ErrAddonsDirNotExist occurs when an addons directory for a workload does not exist.

func (*ErrAddonsDirNotExist) Error added in v0.5.0

func (e *ErrAddonsDirNotExist) Error() string

type Output

type Output struct {
	// Name is the Logical ID of the output.
	Name string
	// IsSecret is true if the output value refers to a SecretsManager ARN. Otherwise, false.
	IsSecret bool
	// IsManagedPolicy is true if the output value refers to an IAM ManagedPolicy ARN. Otherwise, false.
	IsManagedPolicy bool
	// SecurityGroup is true if the output value refers a SecurityGroup ARN. Otherwise, false.
	IsSecurityGroup bool
}

Output represents an output from a CloudFormation template.

func Outputs

func Outputs(template string) ([]Output, error)

Outputs parses the Outputs section of a CloudFormation template to extract logical IDs and returns them.

type RDS added in v1.5.0

type RDS struct {
	RDSProps
	// contains filtered or unexported fields
}

RDS contains configuration options which fully describe a RDS Aurora Serverless cluster. Implements the encoding.BinaryMarshaler interface.

func NewRDS added in v1.5.0

func NewRDS(input RDSProps) *RDS

NewRDS creates a new RDS marshaler which can be used to write CF via addonWriter.

func (*RDS) MarshalBinary added in v1.5.0

func (r *RDS) MarshalBinary() ([]byte, error)

MarshalBinary serializes the RDS object into a binary YAML CF template. Implements the encoding.BinaryMarshaler interface.

type RDSProps added in v1.5.0

type RDSProps struct {
	// The name of the cluster.
	ClusterName string
	// The engine type of the RDS Aurora Serverless cluster.
	Engine string
	// The name of the initial database created inside the cluster.
	InitialDBName string
	// The parameter group to use for the cluster.
	ParameterGroup string
	// The copilot environments found inside the current app.
	Envs []string
}

RDSProps holds RDS-specific properties for addon.NewRDS().

type S3

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

S3 contains configuration options which fully describe an S3 bucket. Implements the encoding.BinaryMarshaler interface.

func NewS3

func NewS3(input *S3Props) *S3

NewS3 creates a new S3 marshaler which can be used to write CF via addonWriter.

func (*S3) MarshalBinary

func (s *S3) MarshalBinary() ([]byte, error)

MarshalBinary serializes the S3 object into a binary YAML CF template. Implements the encoding.BinaryMarshaler interface.

type S3Props

type S3Props struct {
	*StorageProps
}

S3Props contains S3-specific properties for addon.NewS3().

type StorageProps

type StorageProps struct {
	Name string
}

StorageProps holds basic input properties for addon.NewDynamoDB() or addon.NewS3().

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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