-
Notifications
You must be signed in to change notification settings - Fork 47
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
Allow consuming TF code to alter wait_for_capacity_timeout. #23
base: master
Are you sure you want to change the base?
Changes from all commits
a85fa85
79726b3
5800d1b
c2731d1
271baef
62b465e
ee7f1e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,19 +52,32 @@ resource "aws_launch_configuration" "ecs" { | |
} | ||
|
||
resource "aws_autoscaling_group" "ecs" { | ||
name = "asg-${aws_launch_configuration.ecs.name}" | ||
vpc_zone_identifier = ["${var.subnet_id}"] | ||
launch_configuration = "${aws_launch_configuration.ecs.name}" | ||
min_size = "${var.min_servers}" | ||
max_size = "${var.max_servers}" | ||
desired_capacity = "${var.servers}" | ||
termination_policies = ["OldestLaunchConfiguration", "ClosestToNextInstanceHour", "Default"] | ||
|
||
tags = [{ | ||
key = "Name" | ||
value = "${var.name} ${var.tagName}" | ||
propagate_at_launch = true | ||
}] | ||
name_prefix = "asg-${aws_launch_configuration.ecs.name}-" | ||
vpc_zone_identifier = ["${var.subnet_id}"] | ||
launch_configuration = "${aws_launch_configuration.ecs.name}" | ||
min_size = "${var.min_servers}" | ||
max_size = "${var.max_servers}" | ||
desired_capacity = "${var.servers}" | ||
wait_for_capacity_timeout = "${var.wait_for_capacity_timeout}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this add a similar function to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. It's how long TF will wait for a capacity change before timing out. I added it because we had an ASG I wanted to take from 10 to 1 and it timed out. |
||
|
||
termination_policies = [ | ||
"OldestLaunchConfiguration", | ||
"ClosestToNextInstanceHour", | ||
"Default", | ||
] | ||
|
||
tags = [ | ||
{ | ||
key = "Name" | ||
value = "${var.name} ${var.tagName}" | ||
propagate_at_launch = true | ||
}, | ||
{ | ||
key = "Terraform" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! |
||
value = "yes" | ||
propagate_at_launch = true | ||
}, | ||
] | ||
|
||
tags = ["${var.extra_tags}"] | ||
|
||
|
@@ -100,7 +113,8 @@ resource "aws_security_group" "ecs" { | |
} | ||
|
||
tags { | ||
Name = "ecs-sg-${var.name}" | ||
Name = "ecs-sg-${var.name}" | ||
Terraform = "yes" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like these tags, one though, what would you think about the tags reading "true" rather then "yes" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have zero preference. We use this pattern internally, but happy to follow whatever patterns the community/maintainers prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cool, lets switch this to |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change will mean we'll need to cut a new major version release. Am I reading that right? Meaning, if someone upgrades to this version of the module, it'll tear down and recreate the autoscaling groups on them? (I haven't had a chance to pull this code and test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct that it'll tear down any existing ASGs and bring them backup with prefixed names.