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) 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 string) error
- func (cf CloudFormation) DeletePipeline(stackName string) error
- func (cf CloudFormation) DeleteService(in deploy.DeleteServiceInput) 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) 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) RemoveServiceFromApp(app *config.Application, svcName string) error
- func (cf CloudFormation) StreamEnvironmentCreation(env *deploy.CreateEnvironmentInput) (<-chan []deploy.ResourceEvent, <-chan deploy.CreateEnvironmentResponse)
- func (cf CloudFormation) UpdatePipeline(in *deploy.CreatePipelineInput) 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) 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 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) DeleteService ¶
func (cf CloudFormation) DeleteService(in deploy.DeleteServiceInput) error
DeleteService removes the CloudFormation stack of a deployed service.
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) 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) 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) 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) UpdatePipeline ¶
func (cf CloudFormation) UpdatePipeline(in *deploy.CreatePipelineInput) error
UpdatePipeline updates an existing CodePipeline for deploying services.
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.