(aws-ec2): Instance resourceSignalTimeout overwrites initOptions.timeout #30052
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
When specifiying both
resourceSignalTimeout
andinitOptions.timeout
in the options for creating an EC2 Instance, only the value fromresourceSignalTimeout
is used.Expected Behavior
A timeout consisting of the sum of the values, or a clear error that specifying both fields is not supported.
Current Behavior
resourceSignalTimeout
overridesinitOptions.timeout
completely.Reproduction Steps
In a new CDK project:
The resulting template lists for the instance:
Possible Solution
In https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-ec2/lib/instance.ts,
initOptions.timeout
is applied beforeresourceSignalTimeout
. The code to applyinitOptions.timeout
adds it to any preexisting timeout. Swapping the order of setup here should fix the issue.Additional Information/Context
No response
CDK CLI Version
2.136.0 (build 94fd33b)
Framework Version
No response
Node.js Version
v18.18.0
OS
Windows
Language
TypeScript
Language Version
5.0.4
Other information
No response
The text was updated successfully, but these errors were encountered: