addon

package
v1.33.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 20 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 (
	RDSEngineTypeMySQL      = "MySQL"
	RDSEngineTypePostgreSQL = "PostgreSQL"
)

Engine types for RDS Aurora Serverless.

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 AccessPolicyProps added in v1.26.0

type AccessPolicyProps StorageProps

AccessPolicyProps holds properties to configure an access policy to an S3 or DDB storage.

type AccessPolicyTemplate added in v1.26.0

type AccessPolicyTemplate struct {
	AccessPolicyProps
	// contains filtered or unexported fields
}

AccessPolicyTemplate contains configuration options which describe an access policy to an S3 or DDB storage. Implements the encoding.BinaryMarshaler interface.

func EnvDDBAccessPolicyTemplate added in v1.26.0

func EnvDDBAccessPolicyTemplate(input *AccessPolicyProps) *AccessPolicyTemplate

EnvDDBAccessPolicyTemplate creates a marshaller for the access policy attached to a workload for permissions into an environment-level DynamoDB addon.

func EnvS3AccessPolicyTemplate added in v1.26.0

func EnvS3AccessPolicyTemplate(input *AccessPolicyProps) *AccessPolicyTemplate

EnvS3AccessPolicyTemplate creates a new marshaler for the access policy attached to a workload for permissions into an environment-level S3 addon.

func (*AccessPolicyTemplate) MarshalBinary added in v1.26.0

func (t *AccessPolicyTemplate) MarshalBinary() ([]byte, error)

MarshalBinary serializes the content of the template into binary.

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 DynamoDBProps

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

DynamoDBProps contains DynamoDB-specific properties.

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 DynamoDBTemplate added in v1.13.0

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

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

func EnvDDBTemplate added in v1.26.0

func EnvDDBTemplate(input *DynamoDBProps) *DynamoDBTemplate

EnvDDBTemplate creates a marshaller for an environment-level DynamoDB addon.

func WorkloadDDBTemplate added in v1.26.0

func WorkloadDDBTemplate(input *DynamoDBProps) *DynamoDBTemplate

WorkloadDDBTemplate creates a marshaler for a workload-level DynamoDB addon specifying attributes, primary key schema, and local secondary index configuration.

func (*DynamoDBTemplate) MarshalBinary added in v1.13.0

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

MarshalBinary serializes the content of the template into binary.

type EnvironmentStack added in v1.25.0

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

EnvironmentStack represents a CloudFormation stack for environment addons.

func ParseFromEnv added in v1.25.0

func ParseFromEnv(ws WorkspaceAddonsReader) (*EnvironmentStack, error)

ParseFromEnv parses the 'addon/' directory for environments and returns a Stack created by merging the CloudFormation templates files found there. If no addons are found, ParseFromWorkload returns a nil Stack and ErrAddonsNotFound.

func (*EnvironmentStack) Package added in v1.25.0

func (s *EnvironmentStack) Package(cfg PackageConfig) error

Package finds references to local files in Stack's template, uploads the files to S3, and replaces the file path with the S3 location.

func (*EnvironmentStack) Parameters added in v1.25.0

func (s *EnvironmentStack) Parameters() (string, error)

Parameters returns Stack's CloudFormation parameters as a yaml string.

func (*EnvironmentStack) Template added in v1.25.0

func (s *EnvironmentStack) Template() (string, error)

Template returns Stack's CloudFormation template as a yaml string.

type ErrAddonsNotFound added in v1.8.2

type ErrAddonsNotFound struct {
	ParentErr error
}

ErrAddonsNotFound occurs when an addons directory for a workload is either not found or empty.

func (*ErrAddonsNotFound) Error added in v1.8.2

func (e *ErrAddonsNotFound) 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 PackageConfig added in v1.21.0

type PackageConfig struct {
	Bucket        string
	Uploader      uploader
	WorkspacePath string
	FS            afero.Fs
	// contains filtered or unexported fields
}

PackageConfig contains data needed to package a Stack.

type RDSIngressProps added in v1.26.0

type RDSIngressProps struct {
	ClusterName string // The name of the cluster.
	Engine      string // The engine type of the RDS Aurora Serverless cluster.
}

RDSIngressProps holds properties to create a security group ingress to an RDS storage.

type RDSIngressTemplate added in v1.26.0

type RDSIngressTemplate struct {
	RDSIngressProps
	// contains filtered or unexported fields
}

RDSIngressTemplate contains configuration options which describe an ingress to an RDS cluster. Implements the encoding.BinaryMarshaler interface.

func EnvServerlessRDWSIngressTemplate added in v1.26.0

func EnvServerlessRDWSIngressTemplate(input RDSIngressProps) *RDSIngressTemplate

EnvServerlessRDWSIngressTemplate creates a marshaler for the security group ingress attached to an RDWS for permissions into an environment-level Aurora Serverless v2 addon.

func (*RDSIngressTemplate) MarshalBinary added in v1.26.0

func (t *RDSIngressTemplate) MarshalBinary() ([]byte, error)

MarshalBinary serializes the content of the template into binary.

type RDSParams added in v1.13.0

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

RDSParams represents the addons.parameters.yml file for a RDS Aurora Serverless cluster.

func EnvParamsForRDS added in v1.26.0

func EnvParamsForRDS() *RDSParams

EnvParamsForRDS creates a parameter marshaler for an environment-level RDS addon.

func RDWSParamsForEnvRDS added in v1.26.0

func RDWSParamsForEnvRDS() *RDSParams

RDWSParamsForEnvRDS creates a parameter marshaler for the ingress attached to an RDWS for permissions into an environment-level RDS addon.

func RDWSParamsForRDS added in v1.26.0

func RDWSParamsForRDS() *RDSParams

RDWSParamsForRDS creates a new RDS parameters marshaler.

func (*RDSParams) MarshalBinary added in v1.13.0

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

MarshalBinary serializes the content of the params file into binary.

type RDSProps added in v1.5.0

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

RDSProps holds RDS-specific properties.

type RDSTemplate added in v1.13.0

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

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

func EnvServerlessForRDWSTemplate added in v1.26.0

func EnvServerlessForRDWSTemplate(input RDSProps) *RDSTemplate

EnvServerlessForRDWSTemplate creates a marshaler for an environment-level Aurora Serverless v2 addon whose ingress is an RDWS.

func EnvServerlessTemplate added in v1.26.0

func EnvServerlessTemplate(input RDSProps) *RDSTemplate

EnvServerlessTemplate creates a marshaler for an environment-level Aurora Serverless v2 addon.

func RDWSServerlessV1Template added in v1.26.0

func RDWSServerlessV1Template(input RDSProps) *RDSTemplate

RDWSServerlessV1Template creates a marshaler for an Aurora Serverless v1 addon attached on an RDWS.

func RDWSServerlessV2Template added in v1.26.0

func RDWSServerlessV2Template(input RDSProps) *RDSTemplate

RDWSServerlessV2Template creates a marshaler for an Aurora Serverless v2 addon attached on an RDWS.

func WorkloadServerlessV1Template added in v1.26.0

func WorkloadServerlessV1Template(input RDSProps) *RDSTemplate

WorkloadServerlessV1Template creates a marshaler for a workload-level Aurora Serverless v1 addon.

func WorkloadServerlessV2Template added in v1.26.0

func WorkloadServerlessV2Template(input RDSProps) *RDSTemplate

WorkloadServerlessV2Template creates a marshaler for a workload-level Aurora Serverless v2 addon.

func (*RDSTemplate) MarshalBinary added in v1.13.0

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

MarshalBinary serializes the content of the template into binary.

type S3Props

type S3Props struct {
	*StorageProps
}

S3Props contains S3-specific properties.

type S3Template added in v1.13.0

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

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

func EnvS3Template added in v1.26.0

func EnvS3Template(input *S3Props) *S3Template

EnvS3Template creates a new marshaler for an environment-level S3 addon.

func WorkloadS3Template added in v1.26.0

func WorkloadS3Template(input *S3Props) *S3Template

WorkloadS3Template creates a marshaler for a workload-level S3 addon.

func (*S3Template) MarshalBinary added in v1.13.0

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

MarshalBinary serializes the content of the template into binary.

type StorageProps

type StorageProps struct {
	Name string
}

StorageProps holds basic input properties for S3Props and DynamoDBProps.

type WorkloadStack added in v1.25.0

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

WorkloadStack represents a CloudFormation stack for workload addons.

func ParseFromWorkload added in v1.25.0

func ParseFromWorkload(workloadName string, ws WorkspaceAddonsReader) (*WorkloadStack, error)

ParseFromWorkload parses the 'addon/' directory for the given workload and returns a Stack created by merging the CloudFormation templates files found there. If no addons are found, ParseFromWorkload returns a nil Stack and ErrAddonsNotFound.

func (*WorkloadStack) Package added in v1.25.0

func (s *WorkloadStack) Package(cfg PackageConfig) error

Package finds references to local files in Stack's template, uploads the files to S3, and replaces the file path with the S3 location.

func (*WorkloadStack) Parameters added in v1.25.0

func (s *WorkloadStack) Parameters() (string, error)

Parameters returns Stack's CloudFormation parameters as a yaml string.

func (*WorkloadStack) Template added in v1.25.0

func (s *WorkloadStack) Template() (string, error)

Template returns Stack's CloudFormation template as a yaml string.

type WorkspaceAddonsReader added in v1.25.0

type WorkspaceAddonsReader interface {
	WorkloadAddonsAbsPath(name string) string
	WorkloadAddonFileAbsPath(wkldName, fName string) string
	EnvAddonsAbsPath() string
	EnvAddonFileAbsPath(fName string) string
	ListFiles(dirPath string) ([]string, error)
	ReadFile(fPath string) ([]byte, error)
}

WorkspaceAddonsReader finds and reads addons from a workspace.

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