stack

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvOutputCFNExecutionRoleARN       = "CFNExecutionRoleARN"
	EnvOutputManagerRoleKey            = "EnvironmentManagerRoleARN"
	EnvOutputPublicLoadBalancerDNSName = "PublicLoadBalancerDNSName"
	EnvOutputSubdomain                 = "EnvironmentSubdomain"
)

Output keys.

View Source
const (
	LBWebServiceHTTPSParamKey           = "HTTPSEnabled"
	LBWebServiceContainerPortParamKey   = "ContainerPort"
	LBWebServiceRulePathParamKey        = "RulePath"
	LBWebServiceHealthCheckPathParamKey = "HealthCheckPath"
	LBWebServiceTargetContainerParamKey = "TargetContainer"
	LBWebServiceTargetPortParamKey      = "TargetPort"
)

Parameter logical IDs for a load balanced web service.

View Source
const (
	ServiceAppNameParamKey           = "AppName"
	ServiceEnvNameParamKey           = "EnvName"
	ServiceNameParamKey              = "ServiceName"
	ServiceContainerImageParamKey    = "ContainerImage"
	ServiceTaskCPUParamKey           = "TaskCPU"
	ServiceTaskMemoryParamKey        = "TaskMemory"
	ServiceTaskCountParamKey         = "TaskCount"
	ServiceLogRetentionParamKey      = "LogRetention"
	ServiceAddonsTemplateURLParamKey = "AddonsTemplateURL"
)

Parameter logical IDs common across services.

View Source
const (
	AppTagKey     = "copilot-application"
	EnvTagKey     = "copilot-environment"
	ServiceTagKey = "copilot-service"
)

Tag keys used while creating stacks.

View Source
const (
	BackendServiceContainerPortParamKey = "ContainerPort"
)

Parameter logical IDs for a backend service.

View Source
const (
	// EnvTemplatePath is the path where the cloudformation for the environment is written.
	EnvTemplatePath = "environment/cf.yml"
)

Variables

This section is empty.

Functions

func DNSDelegatedAccountsForStack

func DNSDelegatedAccountsForStack(stack *cloudformation.Stack) []string

DNSDelegatedAccountsForStack looks through a stack's parameters for the parameter which stores the comma seperated list of account IDs which are permitted for DNS delegation.

func NameForEnv

func NameForEnv(app, env string) string

NameForEnv returns the stack name for an environment.

func NameForService added in v0.1.0

func NameForService(app, env, svc string) string

NameForService returns the stack name for a service.

func NewPipelineStackConfig

func NewPipelineStackConfig(in *deploy.CreatePipelineInput) *pipelineStackConfig

Types

type AppRegionalResources added in v0.1.0

type AppRegionalResources struct {
	Region         string            // The region these resources are in.
	KMSKeyARN      string            // A KMS Key ARN for encrypting Pipeline artifacts.
	S3Bucket       string            // S3 bucket for Pipeline artifacts.
	RepositoryURLs map[string]string // The image repository URLs by service name.
}

AppRegionalResources represent application resources that are regional.

func ToAppRegionalResources added in v0.1.0

func ToAppRegionalResources(stack *cloudformation.Stack) (*AppRegionalResources, error)

ToAppRegionalResources takes an Application Resource Stack Instance stack, reads the output resources and returns a modeled ProjectRegionalResources.

type AppResourcesConfig added in v0.1.0

type AppResourcesConfig struct {
	Accounts []string `yaml:"Accounts,flow"`
	Services []string `yaml:"Services,flow"`
	App      string   `yaml:"App"`
	Version  int      `yaml:"Version"`
}

AppResourcesConfig is a configuration for a deployed Application StackSet.

func AppConfigFrom added in v0.1.0

func AppConfigFrom(template *string) (*AppResourcesConfig, error)

AppConfigFrom takes a template file and extracts the metadata block, and parses it into an AppStackConfig

type AppStackConfig added in v0.1.0

type AppStackConfig struct {
	*deploy.CreateAppInput
	// contains filtered or unexported fields
}

AppStackConfig is for providing all the values to set up an environment stack and to interpret the outputs from it.

func NewAppStackConfig added in v0.1.0

func NewAppStackConfig(in *deploy.CreateAppInput) *AppStackConfig

NewAppStackConfig sets up a struct which can provide values to CloudFormation for spinning up an environment.

func (*AppStackConfig) Parameters added in v0.1.0

func (c *AppStackConfig) Parameters() ([]*cloudformation.Parameter, error)

Parameters returns a list of parameters which accompany the app CloudFormation template.

func (*AppStackConfig) ResourceTemplate added in v0.1.0

func (c *AppStackConfig) ResourceTemplate(config *AppResourcesConfig) (string, error)

ResourceTemplate generates a StackSet template with all the Application-wide resources (ECR Repos, KMS keys, S3 buckets)

func (*AppStackConfig) StackName added in v0.1.0

func (c *AppStackConfig) StackName() string

StackName returns the name of the CloudFormation stack (based on the application name).

func (*AppStackConfig) StackSetAdminRoleARN added in v0.1.0

func (c *AppStackConfig) StackSetAdminRoleARN() string

StackSetAdminRoleARN returns the role ARN of the role used to administer the Application StackSet.

func (*AppStackConfig) StackSetDescription added in v0.1.0

func (c *AppStackConfig) StackSetDescription() string

StackSetDescription returns the description of the StackSet for application resources.

func (*AppStackConfig) StackSetExecutionRoleName added in v0.1.0

func (c *AppStackConfig) StackSetExecutionRoleName() string

StackSetExecutionRoleName returns the role name of the role used to actually create Application resources.

func (*AppStackConfig) StackSetName added in v0.1.0

func (c *AppStackConfig) StackSetName() string

StackSetName returns the name of the CloudFormation StackSet (based on the application name).

func (*AppStackConfig) Tags added in v0.1.0

func (c *AppStackConfig) Tags() []*cloudformation.Tag

Tags returns the tags that should be applied to the Application CloudFormation stack.

func (*AppStackConfig) Template added in v0.1.0

func (c *AppStackConfig) Template() (string, error)

Template returns the environment CloudFormation template.

type BackendService added in v0.1.0

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

BackendService represents the configuration needed to create a CloudFormation stack from a backend service manifest.

func NewBackendService added in v0.1.0

func NewBackendService(mft *manifest.BackendService, env, app string, rc RuntimeConfig) (*BackendService, error)

NewBackendService creates a new BackendService stack from a manifest file.

func (*BackendService) Parameters added in v0.1.0

func (s *BackendService) Parameters() ([]*cloudformation.Parameter, error)

Parameters returns the list of CloudFormation parameters used by the template.

func (*BackendService) SerializedParameters added in v0.1.0

func (s *BackendService) SerializedParameters() (string, error)

SerializedParameters returns the CloudFormation stack's parameters serialized to a YAML document annotated with comments for readability to users.

func (BackendService) StackName added in v0.1.0

func (s BackendService) StackName() string

StackName returns the name of the stack.

func (BackendService) Tags added in v0.1.0

func (s BackendService) Tags() []*cloudformation.Tag

Tags returns the list of tags to apply to the CloudFormation stack.

func (*BackendService) Template added in v0.1.0

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

Template returns the CloudFormation template for the backend service.

type DeployedAppMetadata added in v0.1.0

type DeployedAppMetadata struct {
	Metadata AppResourcesConfig `yaml:"Metadata"`
}

DeployedAppMetadata wraps the Metadata field of a deployed application StackSet.

type EnvStackConfig

type EnvStackConfig struct {
	*deploy.CreateEnvironmentInput
	// contains filtered or unexported fields
}

EnvStackConfig is for providing all the values to set up an environment stack and to interpret the outputs from it.

func NewEnvStackConfig

func NewEnvStackConfig(input *deploy.CreateEnvironmentInput) *EnvStackConfig

NewEnvStackConfig sets up a struct which can provide values to CloudFormation for spinning up an environment.

func (*EnvStackConfig) Parameters

func (e *EnvStackConfig) Parameters() ([]*cloudformation.Parameter, error)

Parameters returns the parameters to be passed into a environment CloudFormation template.

func (*EnvStackConfig) StackName

func (e *EnvStackConfig) StackName() string

StackName returns the name of the CloudFormation stack (based on the app and env names).

func (*EnvStackConfig) Tags

func (e *EnvStackConfig) Tags() []*cloudformation.Tag

Tags returns the tags that should be applied to the environment CloudFormation stack.

func (*EnvStackConfig) Template

func (e *EnvStackConfig) Template() (string, error)

Template returns the environment CloudFormation template.

func (*EnvStackConfig) ToEnv

ToEnv inspects an environment cloudformation stack and constructs an environment struct out of it (including resources like ECR Repo)

type LoadBalancedWebService added in v0.1.0

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

LoadBalancedWebService represents the configuration needed to create a CloudFormation stack from a load balanced web service manifest.

func NewHTTPSLoadBalancedWebService added in v0.1.0

func NewHTTPSLoadBalancedWebService(mft *manifest.LoadBalancedWebService, env, app string, rc RuntimeConfig) (*LoadBalancedWebService, error)

NewHTTPSLoadBalancedWebService creates a new LoadBalancedWebService stack from its manifest that needs to be deployed to a environment within an application. It creates an HTTPS listener and assumes that the environment it's being deployed into has an HTTPS configured listener.

func NewLoadBalancedWebService added in v0.1.0

func NewLoadBalancedWebService(mft *manifest.LoadBalancedWebService, env, app string, rc RuntimeConfig) (*LoadBalancedWebService, error)

NewLoadBalancedWebService creates a new LoadBalancedWebService stack from a manifest file.

func (*LoadBalancedWebService) Parameters added in v0.1.0

func (s *LoadBalancedWebService) Parameters() ([]*cloudformation.Parameter, error)

Parameters returns the list of CloudFormation parameters used by the template.

func (*LoadBalancedWebService) SerializedParameters added in v0.1.0

func (s *LoadBalancedWebService) SerializedParameters() (string, error)

SerializedParameters returns the CloudFormation stack's parameters serialized to a YAML document annotated with comments for readability to users.

func (LoadBalancedWebService) StackName added in v0.1.0

func (s LoadBalancedWebService) StackName() string

StackName returns the name of the stack.

func (LoadBalancedWebService) Tags added in v0.1.0

func (s LoadBalancedWebService) Tags() []*cloudformation.Tag

Tags returns the list of tags to apply to the CloudFormation stack.

func (*LoadBalancedWebService) Template added in v0.1.0

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

Template returns the CloudFormation template for the service parametrized for the environment.

type RuntimeConfig added in v0.0.8

type RuntimeConfig struct {
	ImageRepoURL      string            // ImageRepoURL is the ECR repository URL the container image should be pushed to.
	ImageTag          string            // ImageTag is the container image's unique tag.
	AddonsTemplateURL string            // Optional. S3 object URL for the addons template.
	AdditionalTags    map[string]string // AdditionalTags are labels applied to resources in the service stack.
}

RuntimeConfig represents configuration that's defined outside of the manifest file that is needed to create a CloudFormation stack.

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