Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeo…
…ut (#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*
- Loading branch information