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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd4d1fdfffc0f2ce0a723529472d555b19195a58e7d2c621fd96b459e1b7e471 |
|
MD5 | f8e19b0f1c1c83c93b73d4c60b172bc6 |
|
BLAKE2b-256 | 0c63691dd36d6611eadf5cd70486b0a04b431f7fb6a8a84d574f28f573555462 |
Hashes for cdklabs.ecs_codedeploy-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd605e7c02f7cd064eaf8037f0e2d6e88506ab6db13c4a6427d60cd0562068f |
|
MD5 | 82a376bc585f984373436d56566834ca |
|
BLAKE2b-256 | 3a96e4c68da451af7b8e9bfb334f3a74943a7a61c3fa5746f121405fdc1632c4 |