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

AutoScaling Warm Pool Hibernated State Support #23752

Closed
mab78611 opened this issue Mar 18, 2022 · 5 comments · Fixed by #23772
Closed

AutoScaling Warm Pool Hibernated State Support #23752

mab78611 opened this issue Mar 18, 2022 · 5 comments · Fixed by #23772
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Milestone

Comments

@mab78611
Copy link

mab78611 commented Mar 18, 2022

Current Terraform Version

1.1.7

AutoScaling

Use-cases

There was an announcement from AWS last month around AutoScaling Warm Pools and added support for "hibernating" during scale-in. The link to the announcement can be found below:
https://aws.amazon.com/about-aws/whats-new/2022/02/amazon-ec2-auto-scaling-warm-pools-supports-hibernating-returning-instances-warm-pools-scale-in/

We currently have a solution in place where pool_state = "Stopped" but would like Terraform to add in support for "Hibernated" state.
As of right now Terraform does not support the Hibernated state:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#pool_state
[pool_state](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#

pool_state) - (Optional) Sets the instance state to transition to after the lifecycle hooks finish. Valid values are: Stopped (default) or Running.

Attempted Solutions

Current state:
warm_pool { pool_state = "Stopped" min_size = var.min_size max_group_prepared_capacity = var.min_size }

Attempted solution:
warm_pool { pool_state = "Hibernated" min_size = var.min_size max_group_prepared_capacity = var.min_size }

│ 
│   with aws_autoscaling_group.Palo-Warm,
│   on Autoscaling.tf line 50, in resource "aws_autoscaling_group" "Palo-Warm":
│   50:     pool_state                  = "Hibernated"```


### Proposal

Add in support for Warm Pools and Hibernated state. 
Is there a timeline for when this will be in place? Thanks 
@mab78611 mab78611 added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 18, 2022
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/autoscaling Issues and PRs that pertain to the autoscaling service. labels Mar 18, 2022
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 18, 2022
@bschaatsbergen
Copy link
Member

I'll happily pick this up and check it out, doing it together with #23735

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Mar 20, 2022

I believe this is already supported as pool_state accepts these aws-sdk-go values (released under v1.43.6). I'll test it out and get back to you.

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Mar 20, 2022

Tested hibernation, seems to work as expected.

resource "aws_launch_template" "example" {
  name_prefix   = "foobar"
  image_id      = "ami-0b28dfc7adc325ef4"
  instance_type = "t2.micro"

  block_device_mappings {
    device_name = "/dev/sda1"

    ebs {
      volume_size = 20
      encrypted   = true
    }
  }
}


resource "aws_autoscaling_group" "default" {
  availability_zones = data.aws_availability_zones.available.names
  desired_capacity   = 1
  max_size           = 3
  min_size           = 1

  launch_template {
    id      = aws_launch_template.example.id
    version = aws_launch_template.example.latest_version
  }

  warm_pool {
    pool_state                  = "Hibernated"
    min_size                    = 1
    max_group_prepared_capacity = 10
  }
}

If there's anything I can help with please let me know @mab78611.

Created a PR to update the docs.

@github-actions
Copy link

This functionality has been released in v4.7.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented May 6, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/autoscaling Issues and PRs that pertain to the autoscaling service.
Projects
None yet
3 participants