-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Bug]: aws_autosacling_group - validation desiredCapacityType incorrect #37523
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Ive got the same issue. It seems that the default values are being set to Update: any console changes to asg are setting desired_capacity_types value, so terraform detects this as a drift and tries to revert that to null, causing the error above Ref on default values: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateAutoScalingGroup.html |
Hey @hans-d 👋 Thank you for taking the time to raise this! Can you supply a sample configuration that can be used to reproduce this and/or debug logging? That information will be useful for whoever picks this up. |
This bug seems to have been here since instance requirement support was added. I have had problems with this for ages.. |
Also happens with AWS provider v5.51.1 |
can second @rctunisi here, ran into this when I modified the ASG in the console and tried to sync it in Terraform code. The only "fix" that can be done for non-critical-absolutely-testonly-workloads I can suggest is to terminate the entire ASG and recreate it and maintain it only in TF, while avoiding editing the capacity units or the number of nodes in the web console. |
I received that error and got some debug logs to help in that case, seems that because desired_capacity is in ignore_changes for resource aws_autoscaling_group the value sent to AWS Autoscaling Group API is empty (&DesiredCapacityType=&MaxSize=3), stopping at API validation. Scenario:
Terraform Error:
Debug Logs:
|
Hello! My team experienced this, and we resolved it by adding the "desired_capacity" and "desired_capacity_type" properties to the Terraform "aws_autoscaling_group" resource, then modifying the resource for the lifecycle tags: |
This worked for me thanks! |
Terraform Core Version
1.5.7
AWS Provider Version
5.45.0, 5.46.0, 5.47.0, 5.48.0, 5.49.0
Affected Resource(s)
aws_autoscaling_group
Expected Behavior
examples as on https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group work
Actual Behavior
Validation error
Relevant Error/Panic Output Snippet
Terraform Configuration Files
see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group
Steps to Reproduce
apply
Debug Output
No response
Panic Output
No response
Important Factoids
The mention variable is optional, but the validation used makes it mandatory
References
https://github.com/hashicorp/terraform-provider-aws/blame/feecd0b738afe3275a54ce2f4c8d3dcb8414014d/internal/service/autoscaling/group.go#L106
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: