-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(autoscaling) maxInstanceLifetime limits doesnt match cloudformation documentation #12588
Comments
Have you tried using CloudFormation directly to set a number < 7 || > 365? The CDK will often encode undocumented CFN limits which are only encounter during deployment. |
I'm afraid I havent. |
|
This is a bug as reported. An user can specify |
### Summary This patch fixes the following bugs in `maxInstanceLifetime` validation by aligning with [CFN doc](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-maxinstancelifetime): - A lower bound of `maxInstanceLifetime` is 1 day, not 7-days. - `maxInstanceLifetime` can have 0 which is used to clear a previously set value. ### Test - Run unit test. ``` PASS test/auto-scaling-group.test.js =============================== Coverage summary =============================== Statements : 93.11% ( 419/450 ) Branches : 86.93% ( 286/329 ) Functions : 91.81% ( 101/110 ) Lines : 92.84% ( 402/433 ) ================================================================================ ``` - Deploy CFN template having `maxInstanceLifetime` as 86,400 and 0. ### Notes Originally, this issue was reported by #12588. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
### Summary This patch fixes the following bugs in `maxInstanceLifetime` validation by aligning with [CFN doc](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-maxinstancelifetime): - A lower bound of `maxInstanceLifetime` is 1 day, not 7-days. - `maxInstanceLifetime` can have 0 which is used to clear a previously set value. ### Test - Run unit test. ``` PASS test/auto-scaling-group.test.js =============================== Coverage summary =============================== Statements : 93.11% ( 419/450 ) Branches : 86.93% ( 286/329 ) Functions : 91.81% ( 101/110 ) Lines : 92.84% ( 402/433 ) ================================================================================ ``` - Deploy CFN template having `maxInstanceLifetime` as 86,400 and 0. ### Notes Originally, this issue was reported by #12588. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
### Summary This patch fixes the following bugs in `maxInstanceLifetime` validation by aligning with [CFN doc](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-maxinstancelifetime): - A lower bound of `maxInstanceLifetime` is 1 day, not 7-days. - `maxInstanceLifetime` can have 0 which is used to clear a previously set value. ### Test - Run unit test. ``` PASS test/auto-scaling-group.test.js =============================== Coverage summary =============================== Statements : 93.11% ( 419/450 ) Branches : 86.93% ( 286/329 ) Functions : 91.81% ( 101/110 ) Lines : 92.84% ( 402/433 ) ================================================================================ ``` - Deploy CFN template having `maxInstanceLifetime` as 86,400 and 0. ### Notes Originally, this issue was reported by aws#12588. ---- ### All Submissions: * [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm unable to configure the maxInstanceLifetime setting in autoscaling group to lower than 7 days
Reproduction Steps
What did you expect to happen?
It should succeed
What actually happened?
it fails with this error:
jsii.errors.JSIIError: maxInstanceLifetime must be between 7 and 365 days (inclusive)
.According to cloudformation, anything above one day is acceptable: "The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day)."
Environment
1.78.0 (build 2c74f4c)
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: