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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb5683c95615ff54ce2dd37d1e1e5290e8276b19d1f97d43106e4afe235fbe57 |
|
MD5 | 545f360ef432b2771bad39dd7d48005c |
|
BLAKE2b-256 | 79853b5e1989bdd4e2314a6456a09809a5a33db7674230e0e7757aefb34b43a7 |
Hashes for cdklabs.ecs_codedeploy-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4fc6ad203947ff245da5e48f6228562858a917b85f38055a8d4ba52e10bdb1c |
|
MD5 | 37d9a342d08c96fbf983057a3e7ea5b5 |
|
BLAKE2b-256 | d2ee5d0da7a5ccca80f9a4010258314816d8d8be185aafb474f0c7f1433c40b1 |