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

AWS ASG Scheduling Support #2367

Closed
dkhunt27 opened this issue Jun 16, 2015 · 7 comments
Closed

AWS ASG Scheduling Support #2367

dkhunt27 opened this issue Jun 16, 2015 · 7 comments

Comments

@dkhunt27
Copy link

Any plans to add support in the AWS provider for add/update a schedule for an AutoScalingGroup? Seems to be the only functionality that we consistently use that terraform doesn't support.

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/AutoScaling.html#putScheduledUpdateGroupAction-property

@ajmath
Copy link
Contributor

ajmath commented Jul 1, 2015

This would be great for my team. We have a cluster that grows in size over night to do batch processing and would like to utilize this. There is an ongoing discussion on the google group including a workaround that uses the awscli in a local provisioner.

https://groups.google.com/forum/#!topic/terraform-tool/EBWHxTtbbtk

@ajmath
Copy link
Contributor

ajmath commented Sep 29, 2015

This is something like what I'm envisioning:

resource "aws_autoscaling_group" "bar" {
  availability_zones = ["us-east-1a"]
  max_size = 15
  min_size = 2
  launch_configuration = "${aws_launch_configuration.bar.name}"
}

/* Scale up and down on a daily schedule */
resource "aws_autoscaling_scheduled_scaling" "reoccurring_scale_up" {
  autoscaling_group_name = "${aws_autoscaling_group.bar.name}"
  recurrence = "0 19 * * *" 
  desired_capacity = 8
}
resource "aws_autoscaling_scheduled_scaling" "reoccurring_scale_down" {
  autoscaling_group_name = "${aws_autoscaling_group.bar.name}"
  recurrence = "0 5 * * *" 
  desired_capacity = 2
}

/* Schedule exact times for scaling */
resource "aws_autoscaling_scheduled_scaling" "cyber_monday_boost_start" {
  autoscaling_group_name = "${aws_autoscaling_group.bar.name}"
  start_time = "2015-11-29T22:00:00Z" 
  desired_capacity = 15
}
resource "aws_autoscaling_scheduled_scaling" "cyber_monday_boost_end" {
  autoscaling_group_name = "${aws_autoscaling_group.bar.name}"
  start_time = "2015-12-01T01:00:00Z" 
  desired_capacity = 8
}

The AWS documentation for this is at http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html

@dkhunt27
Copy link
Author

I am using something very similar....I just created a wrapper around the node aws sdk...but my "inputs" look like

{
        "method": "putScheduledUpdateGroupAction",
        "params": {
          "AutoScalingGroupName": "{{autoScaleGroupName}}",
          "ScheduledActionName": "{{ScheduledActionNamePrefix}}-goToSleep",
          "MinSize": 0,
          "DesiredCapacity": 0,
          "MaxSize": 5,
          "Recurrence": "0 0 * * *"
        }
      },
      {
        "method": "putScheduledUpdateGroupAction",
        "params": {
          "AutoScalingGroupName": "{{autoScaleGroupName}}",
          "ScheduledActionName": "{{ScheduledActionNamePrefix}}-wakeUp",
          "MinSize": 0,
          "DesiredCapacity": 1,
          "MaxSize": 5,
          "Recurrence": "0 12 * * 1-5"
        }
      }

@mcansky
Copy link

mcansky commented Nov 12, 2015

👍

@stack72
Copy link
Contributor

stack72 commented Dec 11, 2015

FYI, I am in the process of adding this #4256

@jen20
Copy link
Contributor

jen20 commented Dec 11, 2015

This has landed in #4256! Thanks @stack72!

@jen20 jen20 closed this as completed Dec 11, 2015
@ghost
Copy link

ghost commented Apr 29, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants