File tree 1 file changed +53
-0
lines changed
packages/@aws-cdk/aws-codedeploy 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 26
26
- [ ECS Applications] ( #ecs-applications )
27
27
- [ ECS Deployment Groups] ( #ecs-deployment-groups )
28
28
- [ ECS Deployment Configurations] ( #ecs-deployment-configurations )
29
+ - [ ECS Deployments] ( #ecs-deployments )
29
30
30
31
## Introduction
31
32
@@ -663,3 +664,55 @@ const deploymentConfig = codedeploy.EcsDeploymentConfig.fromEcsDeploymentConfigN
663
664
' MyExistingDeploymentConfiguration' ,
664
665
);
665
666
```
667
+
668
+ ## ECS Deployments
669
+
670
+ [ ![ cdk-constructs: Experimental] ( https://img.shields.io/badge/cdk--constructs-experimental-important.svg )] ( https://constructs.dev/packages/@cdklabs/cdk-ecs-codedeploy )
671
+
672
+ An experimental construct is available on the Construct Hub called [ @cdklabs/cdk-ecs-codedeploy ] ( https://constructs.dev/packages/@cdklabs/cdk-ecs-codedeploy ) that manages ECS CodeDeploy deployments.
673
+
674
+ ``` ts
675
+ declare const deploymentGroup: codeDeploy .IEcsDeploymentGroup ;
676
+ declare const taskDefinition: ecs .ITaskDefinition ;
677
+
678
+ new EcsDeployment ({
679
+ deploymentGroup ,
680
+ targetService: {
681
+ taskDefinition ,
682
+ containerName: ' mycontainer' ,
683
+ containerPort: 80 ,
684
+ },
685
+ });
686
+ ```
687
+
688
+ The deployment will use the AutoRollbackConfig for the EcsDeploymentGroup unless it is overridden in the deployment:
689
+
690
+ ``` ts
691
+ new EcsDeployment ({
692
+ deploymentGroup ,
693
+ targetService: {
694
+ taskDefinition ,
695
+ containerName: ' mycontainer' ,
696
+ containerPort: 80 ,
697
+ },
698
+ autoRollback: {
699
+ failedDeployment: true ,
700
+ deploymentInAlarm: true ,
701
+ stoppedDeployment: false ,
702
+ },
703
+ });
704
+ ```
705
+
706
+ By default, the CodeDeploy Deployment will timeout after 30 minutes. The timeout value can be overridden:
707
+
708
+ ``` ts
709
+ new EcsDeployment ({
710
+ deploymentGroup ,
711
+ targetService: {
712
+ taskDefinition ,
713
+ containerName: ' mycontainer' ,
714
+ containerPort: 80 ,
715
+ },
716
+ timeout: Duration .minutes (60 ),
717
+ });
718
+ ```
You can’t perform that action at this time.
0 commit comments