diff --git a/main.tf b/main.tf index 5ad1880..f061249 100644 --- a/main.tf +++ b/main.tf @@ -219,14 +219,14 @@ resource "aws_instance" "default" { dynamic "ebs_block_device" { for_each = var.ebs_block_device content { - delete_on_termination = lookup(ebs_block_device.value, "delete_on_termination", null) + delete_on_termination = lookup(ebs_block_device.value, "delete_on_termination", true) device_name = ebs_block_device.value.device_name - encrypted = lookup(ebs_block_device.value, "encrypted", null) + encrypted = lookup(ebs_block_device.value, "encrypted", true) iops = lookup(ebs_block_device.value, "iops", null) - kms_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : lookup(root_block_device.value, "kms_key_id", null) + kms_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : lookup(ebs_block_device.value, "kms_key_id", null) snapshot_id = lookup(ebs_block_device.value, "snapshot_id", null) volume_size = lookup(ebs_block_device.value, "volume_size", null) - volume_type = lookup(ebs_block_device.value, "volume_type", null) + volume_type = lookup(ebs_block_device.value, "volume_type", "gp2") throughput = lookup(ebs_block_device.value, "throughput", null) tags = merge(module.labels.tags, { diff --git a/versions.tf b/versions.tf index 5b25067..6567965 100644 --- a/versions.tf +++ b/versions.tf @@ -7,5 +7,9 @@ terraform { source = "hashicorp/aws" version = ">= 5.13.1" } + tls = { + source = "hashicorp/tls" + version = ">= 4.0" + } } } \ No newline at end of file