CDK Constructs for performing ECS Deployments with CodeDeploy
Project description
CDK ECS CodeDeploy
This project contains CDK constructs to create CodeDeploy ECS deployments.
Installation
TypeScript
yarn add @cdklabs/cdk-ecs-codedeploy
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
Built Distribution
Hashes for cdklabs.ecs-codedeploy-0.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8585b48a641c9a44c8eec1d2a8a7d5f8fad1aa4c41183a59a05be7b68fd56c5f |
|
MD5 | ba98703dec5a009c22b79b7d74002c41 |
|
BLAKE2b-256 | 94d59bc8a71e5e14c84a21e2dda4560d08d8d13fc9547e63520c1e511bc6249b |
Hashes for cdklabs.ecs_codedeploy-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a401cec9926a08594c007de73c2e9665141c51d7094535777b589900e0b68a9 |
|
MD5 | 8b805ba149b6134c3a1656a092e37d3d |
|
BLAKE2b-256 | a336a3f60430d79f2a9037436e0ebf3555494684b990e224cb4854286b0d5bb0 |