Skip to content

Commit

Permalink
graceful instances termination
Browse files Browse the repository at this point in the history
  • Loading branch information
remche committed Jan 22, 2021
1 parent 1e32a0f commit 5fee54b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions modules/node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ data "openstack_images_image_v2" "image" {
}

resource "openstack_compute_instance_v2" "instance" {
depends_on = [var.node_depends_on]
count = var.nodes_count
name = "${var.name_prefix}-${format("%03d", count.index + 1)}"
image_name = var.boot_from_volume ? null : var.image_name
flavor_name = var.flavor_name
key_pair = var.keypair_name
config_drive = var.config_drive
user_data = var.user_data
depends_on = [var.node_depends_on]
count = var.nodes_count
name = "${var.name_prefix}-${format("%03d", count.index + 1)}"
image_name = var.boot_from_volume ? null : var.image_name
flavor_name = var.flavor_name
key_pair = var.keypair_name
config_drive = var.config_drive
user_data = var.user_data
stop_before_destroy = true
availability_zone_hints = length(var.availability_zones) > 0 ? var.availability_zones[count.index % length(var.availability_zones)] : null

network {
Expand Down

0 comments on commit 5fee54b

Please sign in to comment.