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

fix: Added all instance refresh options, including scale in protection and standby instances #243

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ module "asg" {
instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 600
checkpoint_percentages = [35, 70, 100]
instance_warmup = 300
min_healthy_percentage = 50
checkpoint_delay = 600
checkpoint_percentages = [35, 70, 100]
instance_warmup = 300
min_healthy_percentage = 50
auto_rollback = false
standby_instances = "Wait"
scale_in_protected_instances = "Wait"
skip_matching = false
}
triggers = ["tag"]
}
Expand Down
14 changes: 9 additions & 5 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ module "complete" {
instance_refresh = {
strategy = "Rolling"
preferences = {
checkpoint_delay = 600
checkpoint_percentages = [35, 70, 100]
instance_warmup = 300
min_healthy_percentage = 50
auto_rollback = true
checkpoint_delay = 600
checkpoint_percentages = [35, 70, 100]
instance_warmup = 300
min_healthy_percentage = 50
auto_rollback = false
standby_instances = "Wait"
scale_in_protected_instances = "Wait"
skip_matching = false

}
triggers = ["tag"]
}
Expand Down
26 changes: 16 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,14 @@ resource "aws_autoscaling_group" "this" {
dynamic "preferences" {
for_each = try([instance_refresh.value.preferences], [])
content {
checkpoint_delay = try(preferences.value.checkpoint_delay, null)
checkpoint_percentages = try(preferences.value.checkpoint_percentages, null)
instance_warmup = try(preferences.value.instance_warmup, null)
min_healthy_percentage = try(preferences.value.min_healthy_percentage, null)
auto_rollback = try(preferences.value.auto_rollback, null)
checkpoint_delay = try(preferences.value.checkpoint_delay, null)
checkpoint_percentages = try(preferences.value.checkpoint_percentages, null)
instance_warmup = try(preferences.value.instance_warmup, null)
min_healthy_percentage = try(preferences.value.min_healthy_percentage, null)
auto_rollback = try(preferences.value.auto_rollback, null)
scale_in_protected_instances = try(preferences.value.scale_in_protected_instances, null)
standby_instances = try(preferences.value.standby_instances, null)
skip_matching = try(preferences.value.skip_matching, null)
}
}
}
Expand Down Expand Up @@ -675,11 +678,14 @@ resource "aws_autoscaling_group" "idc" {
dynamic "preferences" {
for_each = try([instance_refresh.value.preferences], [])
content {
checkpoint_delay = try(preferences.value.checkpoint_delay, null)
checkpoint_percentages = try(preferences.value.checkpoint_percentages, null)
instance_warmup = try(preferences.value.instance_warmup, null)
min_healthy_percentage = try(preferences.value.min_healthy_percentage, null)
auto_rollback = try(preferences.value.auto_rollback, null)
checkpoint_delay = try(preferences.value.checkpoint_delay, null)
checkpoint_percentages = try(preferences.value.checkpoint_percentages, null)
instance_warmup = try(preferences.value.instance_warmup, null)
min_healthy_percentage = try(preferences.value.min_healthy_percentage, null)
auto_rollback = try(preferences.value.auto_rollback, null)
scale_in_protected_instances = try(preferences.value.scale_in_protected_instances, null)
standby_instances = try(preferences.value.standby_instances, null)
skip_matching = try(preferences.value.skip_matching, null)
}
}
}
Expand Down