addon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 11 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 (
	// 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 service.

func New

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

New creates an Addons object given an service name.

func (*Addons) Template

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

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

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

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).

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 descibe 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().

type ErrDirNotExist

type ErrDirNotExist struct {
	SvcName   string
	ParentErr error
}

ErrDirNotExist occurs when an addons directory for a service does not exist.

func (*ErrDirNotExist) Error

func (e *ErrDirNotExist) 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
}

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 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