Skip to content
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

Open
hans-d opened this issue May 15, 2024 · 4 comments
Open

[Bug]: aws_autosacling_group - validation desiredCapacityType incorrect #37523

hans-d opened this issue May 15, 2024 · 4 comments
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. service/autoscaling Issues and PRs that pertain to the autoscaling service.

Comments

@hans-d
Copy link

hans-d commented May 15, 2024

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

Error: updating Auto Scaling Group: operation error Auto Scaling: UpdateAutoScalingGroup, https response error StatusCode: 400, RequestID: 26d074bd-e530-4453-a76f-a03e1f94fcc8, api error ValidationError: 1 validation error detected: Value '' at 'desiredCapacityType' failed to satisfy constraint: Member must have length greater than or equal to 1

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

@hans-d hans-d added the bug Addresses a defect in current functionality. label May 15, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 15, 2024
@hans-d hans-d changed the title [Bug]: [Bug]: aws_autosacling_group - validation desiredCapacityType incorrect May 15, 2024
@rctunisi
Copy link

rctunisi commented May 23, 2024

Ive got the same issue. It seems that the default values are being set to null, but the default api values for desired_capacity_types for both CreateAutoscalingGroup and UpdateAutoscalingGroup is units

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
https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_UpdateAutoScalingGroup.html

@justinretzolk
Copy link
Member

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.

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. service/autoscaling Issues and PRs that pertain to the autoscaling service. labels May 24, 2024
@herrbpl
Copy link

herrbpl commented May 27, 2024

This bug seems to have been here since instance requirement support was added. I have had problems with this for ages..

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Projects
None yet
Development

No branches or pull requests

4 participants