Skip to main content

CDK Constructs for performing ECS Deployments with CodeDeploy

Project description

CDK ECS CodeDeploy

npm version Maven Central PyPI version NuGet version Gitpod Ready-to-Code Mergify

This project contains CDK constructs to create CodeDeploy ECS deployments.

Installation

TypeScript
yarn add @cdklabs/cdk-ecs-codedeploy
Java

See https://mvnrepository.com/artifact/io.github.cdklabs/cdk-ecs-codedeploy

Python

See https://pypi.org/project/cdklabs.ecs-codedeploy/

C#

See https://www.nuget.org/packages/Cdklabs.CdkEcsCodeDeploy/

Getting Started

You can browse the documentation at https://constructs.dev/packages/cdk-ecs-codedeploy/

CodeDeploy for ECS can manage the deployment of new task definitions to ECS services. Only 1 deployment construct can be defined for a given EcsDeploymentGroup.

declare const deploymentGroup: codeDeploy.IEcsDeploymentGroup;
declare const taskDefinition: ecs.ITaskDefinition;

EcsDeployment.forDeploymentGroup({
  deploymentGroup,
  appspec: new codedeploy.EcsAppSpec({
    taskDefinition,
    containerName: 'mycontainer',
    containerPort: 80,
  }),
});

The deployment will use the AutoRollbackConfig for the EcsDeploymentGroup unless it is overridden in the deployment:

EcsDeployment.forDeploymentGroup({
  deploymentGroup,
  appspec: new codedeploy.EcsAppSpec({
    taskDefinition,
    containerName: 'mycontainer',
    containerPort: 80,
  }),
  autoRollback: {
    failedDeployment: true,
    deploymentInAlarm: true,
    stoppedDeployment: false,
  },
});

By default, the deployment will timeout after 30 minutes. The timeout value can be overridden:

EcsDeployment.forDeploymentGroup({
  deploymentGroup,
  appspec: new codedeploy.EcsAppSpec({
    taskDefinition,
    containerName: 'mycontainer',
    containerPort: 80,
  }),
  timeout: Duration.minutes(60),
});

Local Development

yarn install
yarn build
yarn test

To run an integration test and update the snapshot, run:

yarn integ:deployment:deploy

To recreate snapshots for integration tests, run:

yarn integ:snapshot-all

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdklabs.ecs-codedeploy-0.0.14.tar.gz (10.4 MB view hashes)

Uploaded Source

Built Distribution

cdklabs.ecs_codedeploy-0.0.14-py3-none-any.whl (10.4 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page