Skip to content

Commit

Permalink
fix(ec2): instance resourceSignalTimeout overwrites initOptions.timeo…
Browse files Browse the repository at this point in the history
…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
michelle-wangg authored Sep 24, 2024
1 parent 5e95ba2 commit a29bf19
Show file tree
Hide file tree
Showing 24 changed files with 2,646 additions and 26 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a29bf19

Please sign in to comment.