 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package addon contains the service to manage addons.
Package addon contains the service to manage addons.
Index ¶
- Constants
- type DDBAttribute
- type DDBLocalSecondaryIndex
- type DynamoDBProps
- type DynamoDBTemplate
- type EnvironmentStack
- type ErrAddonsNotFound
- type Output
- type PackageConfig
- type RDSParams
- type RDSProps
- type RDSTemplate
- type S3Props
- type S3Template
- type StorageProps
- type WorkloadStack
- type WorkspaceAddonsReader
Constants ¶
const ( // Engine types for RDS Aurora Serverless. RDSEngineTypeMySQL = "MySQL" RDSEngineTypePostgreSQL = "PostgreSQL" )
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 DDBAttribute ¶
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 ¶
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 for addon.NewDDBTemplate().
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 NewDDBTemplate ¶ added in v1.13.0
func NewDDBTemplate(input *DynamoDBProps) *DynamoDBTemplate
NewDDBTemplate creates a DynamoDB cloudformation template 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
Parameters returns Stack's CloudFormation parameters 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.
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 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 NewRDSParams ¶ added in v1.13.0
func NewRDSParams() *RDSParams
NewRDSParams creates a new RDS parameters marshaler.
func (*RDSParams) MarshalBinary ¶ added in v1.13.0
MarshalBinary serializes the content of the params file into binary.
type RDSProps ¶ added in v1.5.0
type RDSProps struct {
	WorkloadType string // The type of the workload associated with the RDS addon.
	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.
	// contains filtered or unexported fields
}
    RDSProps holds RDS-specific properties for addon.NewRDSTemplate().
type RDSTemplate ¶ added in v1.13.0
type RDSTemplate struct {
	RDSProps
	// contains filtered or unexported fields
}
    RDSTemplate contains configuration options which fully describe a RDS Aurora Serverless cluster. Implements the encoding.BinaryMarshaler interface.
func NewServerlessV1Template ¶ added in v1.23.0
func NewServerlessV1Template(input RDSProps) *RDSTemplate
NewServerlessV1Template creates a new RDS marshaler which can be used to write an Aurora Serverless v1 CloudFormation template.
func NewServerlessV2Template ¶ added in v1.23.0
func NewServerlessV2Template(input RDSProps) *RDSTemplate
NewServerlessV2Template creates a new RDS marshaler which can be used to write an Aurora Serverless v2 CloudFormation template.
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 for addon.NewS3Template().
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 NewS3Template ¶ added in v1.13.0
func NewS3Template(input *S3Props) *S3Template
NewS3Template creates a new S3 marshaler which can be used to write CF via addonWriter.
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 addon.NewDDBTemplate() or addon.NewS3Template().
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
Parameters returns Stack's CloudFormation parameters as a yaml string.
type WorkspaceAddonsReader ¶ added in v1.25.0
type WorkspaceAddonsReader interface {
	WorkloadAddonsPath(name string) string
	WorkloadAddonFilePath(wkldName, fName string) string
	EnvAddonsPath() string
	EnvAddonFilePath(fName string) string
	ListFiles(dirPath string) ([]string, error)
	ReadFile(fPath string) ([]byte, error)
}
    WorkspaceAddonsReader finds and reads addons from a workspace.