From af0dc1b5dec108ad5f5e52f587678e7c4d5a3369 Mon Sep 17 00:00:00 2001 From: go-to-k <24818752+go-to-k@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:26:36 +0900 Subject: [PATCH] sample codes sample codes --- .../ec2/integ.task-definition-container-restart-policy.ts | 2 +- packages/aws-cdk-lib/aws-ecs/README.md | 2 +- .../aws-cdk-lib/aws-ecs/test/container-definition.test.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-container-restart-policy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-container-restart-policy.ts index d0edf035c2c05..9e1c65360348c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-container-restart-policy.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/ec2/integ.task-definition-container-restart-policy.ts @@ -10,7 +10,7 @@ const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', {}); taskDefinition.addContainer('Container', { image: ecs.ContainerImage.fromRegistry('public.ecr.aws/ecs-sample-image/amazon-ecs-sample:latest'), enableRestartPolicy: true, - restartIgnoredExitCodes: [1, 2, 3], + restartIgnoredExitCodes: [0, 127], restartAttemptPeriod: cdk.Duration.seconds(360), }); diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 0efa1354df967..f44e893b7df5c 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -630,7 +630,7 @@ declare const taskDefinition: ecs.TaskDefinition; taskDefinition.addContainer('container', { image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"), enableRestartPolicy: true, - restartIgnoredExitCodes: [1, 2, 3], + restartIgnoredExitCodes: [0, 127], restartAttemptPeriod: cdk.Duration.seconds(360), }); ``` diff --git a/packages/aws-cdk-lib/aws-ecs/test/container-definition.test.ts b/packages/aws-cdk-lib/aws-ecs/test/container-definition.test.ts index c485c566912b4..0ee37461bb7f4 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/container-definition.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/container-definition.test.ts @@ -2769,7 +2769,7 @@ describe('container definition', () => { image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'), taskDefinition, enableRestartPolicy: true, - restartIgnoredExitCodes: [1, 2, 3], + restartIgnoredExitCodes: [0, 127], restartAttemptPeriod: cdk.Duration.seconds(360), }); @@ -2781,7 +2781,7 @@ describe('container definition', () => { Name: 'Container', RestartPolicy: { Enabled: true, - IgnoredExitCodes: [1, 2, 3], + IgnoredExitCodes: [0, 127], RestartAttemptPeriod: 360, }, }, @@ -2799,7 +2799,7 @@ describe('container definition', () => { image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'), taskDefinition, enableRestartPolicy: false, - restartIgnoredExitCodes: [1, 2, 3], + restartIgnoredExitCodes: [0, 127], restartAttemptPeriod: cdk.Duration.seconds(360), }); @@ -2824,7 +2824,7 @@ describe('container definition', () => { new ecs.ContainerDefinition(stack, 'Container', { image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'), taskDefinition, - restartIgnoredExitCodes: [1, 2, 3], + restartIgnoredExitCodes: [0, 127], restartAttemptPeriod: cdk.Duration.seconds(360), });