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]: wait_for_capacity_timeout is ignored in aws_autoscaling_group in case of insufficient capacity #33665

Open
AIByteSmith opened this issue Sep 27, 2023 · 1 comment
Labels
bug Addresses a defect in current functionality. service/autoscaling Issues and PRs that pertain to the autoscaling service.

Comments

@AIByteSmith
Copy link

AIByteSmith commented Sep 27, 2023

Terraform Core Version

1.5.7

AWS Provider Version

5.18.1

Affected Resource(s)

aws_autoscaling_group

Expected Behavior

Apply should wait for wait_for_capacity_timeout amount of time before failing with an error.

Actual Behavior

Apply is almost immediately failing with an error. 1 minute instead of 10 minutes for example

Relevant Error/Panic Output Snippet

Error: waiting for Auto Scaling Group (<blah>) capacity satisfied: scaling activity (<blah>): Failed: We currently do not have sufficient g5.12xlarge capacity in the Availability Zone you requested (us-east-1b). Our system will be working on provisioning additional capacity. You can currently get g5.12xlarge capacity by not specifying an Availability Zone in your request or choosing us-east-1a, us-east-1c, us-east-1d, us-east-1f. Launching EC2 instance failed.
│ 
│   with aws_autoscaling_group.<blah>,
│   on ec2.tf line 179, in resource "aws_autoscaling_group" "<blah>":
│  179: resource "aws_autoscaling_group" "<blah>" {

Terraform Configuration Files

resource "aws_autoscaling_group" "my_asg" {
  name                      = "my_asg"
  desired_capacity          = 1
  launch_template {
    id      = aws_launch_template.model_launch_template.id
    version = aws_launch_template.model_launch_template.latest_version
  }
  max_size              = 1
  min_size              = 0
  vpc_zone_identifier   = data.aws_subnets.private.ids
}

resource "aws_launch_template" "model_launch_template" {
  image_id      = "/aws/service/ecs/optimized-ami/amazon-linux-2/gpu/recommended/image_id"
  instance_type = "g5.12xlarge"
  ebs_optimized = true

  user_data = base64encode(<<EOF
#!/bin/bash
echo "ECS_CLUSTER=${aws_ecs_cluster.my_asg.name}" >> /etc/ecs/ecs.config
EOF
  )
}

Steps to Reproduce

  • use the above configuration to do a terraform apply.
  • wait for g5.12xlarge (or some other in-demand instance type) to not be available
  • observe error after short time

Debug Output

No response

Panic Output

No response

Important Factoids

I believe this bug was previously reported, but then fixed and closed. Maybe it has resurfaced? Old bug:
#29753

References

No response

Would you like to implement a fix?

No

@AIByteSmith AIByteSmith added the bug Addresses a defect in current functionality. label Sep 27, 2023
@github-actions
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.

@github-actions github-actions bot added service/autoscaling Issues and PRs that pertain to the autoscaling service. service/ec2 Issues and PRs that pertain to the ec2 service. labels Sep 27, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 27, 2023
@justinretzolk justinretzolk removed service/ec2 Issues and PRs that pertain to the ec2 service. needs-triage Waiting for first response or review from a maintainer. labels Oct 26, 2023
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. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Projects
None yet
Development

No branches or pull requests

2 participants