cloudformation

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEnvToAppOpts added in v1.4.0

type AddEnvToAppOpts struct {
	App          *config.Application
	EnvName      string
	EnvAccountID string
	EnvRegion    string
}

AddEnvToAppOpts contains the parameters to call AddEnvToApp.

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(opts *AddEnvToAppOpts) 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, bucketName string) 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) DeleteTask added in v1.1.0

func (cf CloudFormation) DeleteTask(task deploy.TaskStackInfo) error

DeleteTask deletes a Copilot-created one-off task stack using the RoleARN that stack was created with. If there is no role arn specified, it tries to delete the stack using the default session.

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) DeployAndRenderEnvironment added in v1.1.0

func (cf CloudFormation) DeployAndRenderEnvironment(out progress.FileWriter, env *deploy.CreateEnvironmentInput) error

DeployAndRenderEnvironment creates the CloudFormation stack for an environment, and render the stack creation to out.

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) DeployService

DeployService deploys a service stack and renders progress updates to out 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

DeployTask deploys a task stack, renders the deployment to out until it 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) 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) GetTaskStack added in v1.2.0

func (cf CloudFormation) GetTaskStack(taskName string) (*deploy.TaskStackInfo, error)

GetTaskStack grabs information about the given one-off task's cloudformation stack and returns it to the user in a convenient struct.

func (CloudFormation) ListDefaultTaskStacks added in v1.1.0

func (cf CloudFormation) ListDefaultTaskStacks() ([]deploy.TaskStackInfo, error)

ListDefaultTaskStacks returns all the CF stacks created by copilot but not associated with an application.

func (CloudFormation) ListTaskStacks added in v1.1.0

func (cf CloudFormation) ListTaskStacks(appName, envName string) ([]deploy.TaskStackInfo, error)

ListTaskStacks returns all the CF stacks which represent one-off copilot tasks in a given application's environments.

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) 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, bucketName string) error

UpdatePipeline updates an existing CodePipeline for deploying services.

func (CloudFormation) UpgradeApplication added in v1.5.0

func (cf CloudFormation) UpgradeApplication(in *deploy.CreateAppInput) error

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.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
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