Skip to content

Commit a29bf19

Browse files
fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeout (#31446)
### Issue # (if applicable) Closes #30052 ### Reason for this change When specifiying both `resourceSignalTimeout` and `initOptions.timeout` in the options for creating an EC2 Instance, only the value from `resourceSignalTimeout` is used. ### Description of changes - If both `initOptions.timeout` and `resourceSignalTimeout` are set, timeout consisting of the sum of the values and a warning suggesting that only one field should be specified - Else, timeout is set to field specified, else defaults to 5 min ### Description of how you validated changes - Update integration test for `instance-init.js` with both fields and verify that warning is logged - Add unit tests: - `initOptions.timeout` and `resourceSignalTimeout` are both not set, timeout is set to default of 5 min - `initOptions.timeout` set and `resourceSignalTimeout` not set, timeout is set to initOptions.timeout - `initOptions.timeout` not set and `resourceSignalTimeout` is set, timeout is set to `resourceSignalTimeout` - `initOptions.timeout` and `resourceSignalTimeout` are both set, timeout is set to sum of timeouts and warning is logged ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5e95ba2 commit a29bf19

24 files changed

+2646
-26
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.enable-sum-timeout-instance-init.js.snapshot/EnableSumTimeoutInstanceTestDefaultTestDeployAssert5CD5B9B5.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.enable-sum-timeout-instance-init.js.snapshot/EnableSumTimeoutInstanceTestDefaultTestDeployAssert5CD5B9B5.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.enable-sum-timeout-instance-init.js.snapshot/asset.f8a1af398dac2fad92eeea4fb7620be1c4f504e23e3bfcd859fbb5744187930b/testFile

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.enable-sum-timeout-instance-init.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.enable-sum-timeout-instance-init.js.snapshot/integ-init.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)