Documentation ¶
Overview ¶
Package cloudformation provides functionality to deploy CLI concepts with AWS CloudFormation.
Package cloudformation provides functionality to deploy ECS resources with AWS CloudFormation.
Package cloudformation provides functionality to deploy ECS resources with AWS CloudFormation. This file defines API for deploying a pipeline.
Index ¶
- type CloudFormation
- func (cf CloudFormation) AddEnvToApp(app *config.Application, env *config.Environment) error
- func (cf CloudFormation) AddJobToApp(app *config.Application, jobName string) error
- func (cf CloudFormation) AddPipelineResourcesToApp(app *config.Application, appRegion string) error
- func (cf CloudFormation) AddServiceToApp(app *config.Application, svcName string) error
- func (cf CloudFormation) CreatePipeline(in *deploy.CreatePipelineInput) error
- func (cf CloudFormation) DelegateDNSPermissions(app *config.Application, accountID string) error
- func (cf CloudFormation) DeleteApp(appName string) error
- func (cf CloudFormation) DeleteEnvironment(appName, envName, cfnExecRoleARN string) error
- func (cf CloudFormation) DeletePipeline(stackName string) error
- func (cf CloudFormation) DeleteWorkload(in deploy.DeleteWorkloadInput) error
- func (cf CloudFormation) DeployApp(in *deploy.CreateAppInput) error
- func (cf CloudFormation) DeployEnvironment(env *deploy.CreateEnvironmentInput) error
- func (cf CloudFormation) DeployService(conf StackConfiguration, opts ...cloudformation.StackOption) error
- func (cf CloudFormation) DeployTask(input *deploy.CreateTaskResourcesInput, opts ...cloudformation.StackOption) error
- func (cf CloudFormation) EnvironmentTemplate(appName, envName string) (string, error)
- func (cf CloudFormation) ErrorEvents(conf StackConfiguration) ([]deploy.ResourceEvent, error)
- func (cf CloudFormation) GetAppResourcesByRegion(app *config.Application, region string) (*stack.AppRegionalResources, error)
- func (cf CloudFormation) GetEnvironment(appName, envName string) (*config.Environment, error)
- func (cf CloudFormation) GetRegionalAppResources(app *config.Application) ([]*stack.AppRegionalResources, error)
- func (cf CloudFormation) PipelineExists(in *deploy.CreatePipelineInput) (bool, error)
- func (cf CloudFormation) RemoveJobFromApp(app *config.Application, jobName string) error
- func (cf CloudFormation) RemoveServiceFromApp(app *config.Application, svcName string) error
- func (cf CloudFormation) StreamEnvironmentCreation(env *deploy.CreateEnvironmentInput) (<-chan []deploy.ResourceEvent, <-chan deploy.CreateEnvironmentResponse)
- func (cf CloudFormation) UpdateEnvironmentTemplate(appName, envName, templateBody, cfnExecRoleARN string) error
- func (cf CloudFormation) UpdatePipeline(in *deploy.CreatePipelineInput) error
- func (cf CloudFormation) UpgradeEnvironment(in *deploy.CreateEnvironmentInput) error
- func (cf CloudFormation) UpgradeLegacyEnvironment(in *deploy.CreateEnvironmentInput, lbWebServices ...string) error
- type StackConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudFormation ¶
type CloudFormation struct {
// contains filtered or unexported fields
}
CloudFormation wraps the CloudFormationAPI interface
func New ¶
func New(sess *session.Session) CloudFormation
New returns a configured CloudFormation client.
func (CloudFormation) AddEnvToApp ¶
func (cf CloudFormation) AddEnvToApp(app *config.Application, env *config.Environment) error
AddEnvToApp takes a new environment and updates the application configuration with new Account IDs in resource policies (KMS Keys and ECR Repos) - and sets up a new stack instance if the environment is in a new region.
func (CloudFormation) AddJobToApp ¶ added in v0.5.0
func (cf CloudFormation) AddJobToApp(app *config.Application, jobName string) error
AddJobToApp attempts to add new job-specific resources to the application resource stack. Currently, this means that we'll set up an ECR repo with a policy for all envs to be able to pull from it.
func (CloudFormation) AddPipelineResourcesToApp ¶
func (cf CloudFormation) AddPipelineResourcesToApp( app *config.Application, appRegion string) error
AddPipelineResourcesToApp conditionally adds resources needed to support a pipeline in the application region (i.e. the same region that hosts our SSM store). This is necessary because the application region might not contain any environment.
func (CloudFormation) AddServiceToApp ¶
func (cf CloudFormation) AddServiceToApp(app *config.Application, svcName string) error
AddServiceToApp attempts to add new service specific resources to the application resource stack. Currently, this means that we'll set up an ECR repo with a policy for all envs to be able to pull from it.
func (CloudFormation) CreatePipeline ¶
func (cf CloudFormation) CreatePipeline(in *deploy.CreatePipelineInput) error
CreatePipeline sets up a new CodePipeline for deploying services.
func (CloudFormation) DelegateDNSPermissions ¶
func (cf CloudFormation) DelegateDNSPermissions(app *config.Application, accountID string) error
DelegateDNSPermissions grants the provided account ID the ability to write to this application's DNS HostedZone. This allows us to perform cross account DNS delegation.
func (CloudFormation) DeleteApp ¶
func (cf CloudFormation) DeleteApp(appName string) error
DeleteApp deletes all application specific StackSet and Stack resources.
func (CloudFormation) DeleteEnvironment ¶
func (cf CloudFormation) DeleteEnvironment(appName, envName, cfnExecRoleARN string) error
DeleteEnvironment deletes the CloudFormation stack of an environment.
func (CloudFormation) DeletePipeline ¶
func (cf CloudFormation) DeletePipeline(stackName string) error
DeletePipeline removes the CodePipeline stack.
func (CloudFormation) DeleteWorkload ¶ added in v0.5.0
func (cf CloudFormation) DeleteWorkload(in deploy.DeleteWorkloadInput) error
DeleteWorkload removes the CloudFormation stack of a deployed workload.
func (CloudFormation) DeployApp ¶
func (cf CloudFormation) DeployApp(in *deploy.CreateAppInput) error
DeployApp sets up everything required for our application-wide resources. These resources include things that are regional, rather than scoped to a particular environment, such as ECR Repos, CodePipeline KMS keys & S3 buckets. We deploy application resources through StackSets - that way we can have one template that we update and all regional stacks are updated.
func (CloudFormation) DeployEnvironment ¶
func (cf CloudFormation) DeployEnvironment(env *deploy.CreateEnvironmentInput) error
DeployEnvironment creates the CloudFormation stack for an environment by creating and executing a change set.
If the deployment succeeds, returns nil. If the stack already exists, returns a ErrStackAlreadyExists. If the change set to create the stack cannot be executed, returns a ErrNotExecutableChangeSet. Otherwise, returns a wrapped error.
func (CloudFormation) DeployService ¶
func (cf CloudFormation) DeployService(conf StackConfiguration, opts ...cloudformation.StackOption) error
DeployService deploys a service stack and waits until the deployment is done. If the service stack doesn't exist, then it creates the stack. If the service stack already exists, it updates the stack.
func (CloudFormation) DeployTask ¶
func (cf CloudFormation) DeployTask(input *deploy.CreateTaskResourcesInput, opts ...cloudformation.StackOption) error
DeployTask deploys a task stack and waits until the deployment is done. If the task stack doesn't exist, then it creates the stack. If the task stack already exists, it updates the stack. If the task stack doesn't have any changes, it returns nil
func (CloudFormation) EnvironmentTemplate ¶ added in v0.5.0
func (cf CloudFormation) EnvironmentTemplate(appName, envName string) (string, error)
EnvironmentTemplate returns the environment's stack's template.
func (CloudFormation) ErrorEvents ¶ added in v0.6.0
func (cf CloudFormation) ErrorEvents(conf StackConfiguration) ([]deploy.ResourceEvent, error)
ErrorEvents returns the list of Cloudformation Resource Events, filtered by failures and erros.
func (CloudFormation) GetAppResourcesByRegion ¶
func (cf CloudFormation) GetAppResourcesByRegion(app *config.Application, region string) (*stack.AppRegionalResources, error)
GetAppResourcesByRegion fetches all the regional resources for a particular region.
func (CloudFormation) GetEnvironment ¶
func (cf CloudFormation) GetEnvironment(appName, envName string) (*config.Environment, error)
GetEnvironment returns the Environment metadata from the CloudFormation stack.
func (CloudFormation) GetRegionalAppResources ¶
func (cf CloudFormation) GetRegionalAppResources(app *config.Application) ([]*stack.AppRegionalResources, error)
GetRegionalAppResources fetches all the regional resources for a particular application.
func (CloudFormation) PipelineExists ¶
func (cf CloudFormation) PipelineExists(in *deploy.CreatePipelineInput) (bool, error)
PipelineExists checks if the pipeline with the provided config exists.
func (CloudFormation) RemoveJobFromApp ¶ added in v0.5.0
func (cf CloudFormation) RemoveJobFromApp(app *config.Application, jobName string) error
RemoveJobFromApp attempts to remove job-specific resources (ECR repositories) from the application resource stack.
func (CloudFormation) RemoveServiceFromApp ¶
func (cf CloudFormation) RemoveServiceFromApp(app *config.Application, svcName string) error
RemoveServiceFromApp attempts to remove service-specific resources (ECR repositories) from the application resource stack.
func (CloudFormation) StreamEnvironmentCreation ¶
func (cf CloudFormation) StreamEnvironmentCreation(env *deploy.CreateEnvironmentInput) (<-chan []deploy.ResourceEvent, <-chan deploy.CreateEnvironmentResponse)
StreamEnvironmentCreation streams resource update events while a deployment is taking place. Once the CloudFormation stack operation halts, the update channel is closed and a CreateEnvironmentResponse is sent to the second channel.
func (CloudFormation) UpdateEnvironmentTemplate ¶ added in v0.5.0
func (cf CloudFormation) UpdateEnvironmentTemplate(appName, envName, templateBody, cfnExecRoleARN string) error
UpdateEnvironmentTemplate updates the cloudformation stack's template body while maintaining the parameters and tags.
func (CloudFormation) UpdatePipeline ¶
func (cf CloudFormation) UpdatePipeline(in *deploy.CreatePipelineInput) error
UpdatePipeline updates an existing CodePipeline for deploying services.
func (CloudFormation) UpgradeEnvironment ¶ added in v0.5.0
func (cf CloudFormation) UpgradeEnvironment(in *deploy.CreateEnvironmentInput) error
UpgradeEnvironment updates an environment stack's template to a newer version.
func (CloudFormation) UpgradeLegacyEnvironment ¶ added in v0.5.0
func (cf CloudFormation) UpgradeLegacyEnvironment(in *deploy.CreateEnvironmentInput, lbWebServices ...string) error
UpgradeLegacyEnvironment updates a legacy environment stack to a newer version.
UpgradeEnvironment and UpgradeLegacyEnvironment are separate methods because the legacy cloudformation stack has the "IncludePublicLoadBalancer" parameter which has been deprecated in favor of the "ALBWorkloads". UpgradeLegacyEnvironment does the necessary transformation to use the "ALBWorkloads" parameter instead.
type StackConfiguration ¶
type StackConfiguration interface { StackName() string Template() (string, error) Parameters() ([]*sdkcloudformation.Parameter, error) Tags() []*sdkcloudformation.Tag }
StackConfiguration represents the set of methods needed to deploy a cloudformation stack.