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.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f570fcd4d22b4d9a3e4001c2da762050beaf6d6b898074ac8c48e4e5ce1824fd |
|
MD5 | 31f1468723f2742844de7a46d7f8f6de |
|
BLAKE2b-256 | b1fe10f7dafe04f4c1c092f2988248a60024f1007a182d1e94e1958ff4de23fa |
Hashes for cdklabs.ecs_codedeploy-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ffd13dfdc974d5a320ba4648fc1220fa7703931c10d73f3c6d962e0349503d8 |
|
MD5 | 515111d351b529047388063c255c5571 |
|
BLAKE2b-256 | 239bb271ead0c40377c5f49b96a4fa3013f4e1b03e50d962dd5a68500183b6b6 |