diff --git a/README.md b/README.md index 19fc80e4..0b9c423e 100644 --- a/README.md +++ b/README.md @@ -168,13 +168,13 @@ The following combinations are supported to conditionally create resources: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 4.7 | +| [aws](#requirement\_aws) | >= 4.20.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.7 | +| [aws](#provider\_aws) | >= 4.20.0 | ## Modules @@ -200,6 +200,7 @@ No modules. | [cpu\_threads\_per\_core](#input\_cpu\_threads\_per\_core) | Sets the number of CPU threads per core for an instance (has no effect unless cpu\_core\_count is also set). | `number` | `null` | no | | [create](#input\_create) | Whether to create an instance | `bool` | `true` | no | | [create\_spot\_instance](#input\_create\_spot\_instance) | Depicts if the instance is a spot instance | `bool` | `false` | no | +| [disable\_api\_stop](#input\_disable\_api\_stop) | If true, enables EC2 Instance Stop Protection. | `bool` | `null` | no | | [disable\_api\_termination](#input\_disable\_api\_termination) | If true, enables EC2 Instance Termination Protection | `bool` | `null` | no | | [ebs\_block\_device](#input\_ebs\_block\_device) | Additional EBS block devices to attach to the instance | `list(map(string))` | `[]` | no | | [ebs\_optimized](#input\_ebs\_optimized) | If true, the launched EC2 instance will be EBS-optimized | `bool` | `null` | no | diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 8f9a9553..257ff71c 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -95,6 +95,7 @@ module "ec2_complete" { vpc_security_group_ids = [module.security_group.security_group_id] placement_group = aws_placement_group.web.id associate_public_ip_address = true + disable_api_stop = false # only one of these can be enabled at a time hibernation = true diff --git a/main.tf b/main.tf index 1e027c2d..b4eb9d3b 100644 --- a/main.tf +++ b/main.tf @@ -120,6 +120,7 @@ resource "aws_instance" "this" { source_dest_check = length(var.network_interface) > 0 ? null : var.source_dest_check disable_api_termination = var.disable_api_termination + disable_api_stop = var.disable_api_stop instance_initiated_shutdown_behavior = var.instance_initiated_shutdown_behavior placement_group = var.placement_group tenancy = var.tenancy diff --git a/variables.tf b/variables.tf index 54ec88c1..1f140fd4 100644 --- a/variables.tf +++ b/variables.tf @@ -305,6 +305,12 @@ variable "spot_valid_from" { default = null } +variable "disable_api_stop" { + description = "If true, enables EC2 Instance Stop Protection." + type = bool + default = null + +} variable "putin_khuylo" { description = "Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo!" type = bool diff --git a/versions.tf b/versions.tf index 36060f73..0836352d 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.7" + version = ">= 4.20.0" } } } diff --git a/wrappers/main.tf b/wrappers/main.tf index 3eec1a5f..3af75fd2 100644 --- a/wrappers/main.tf +++ b/wrappers/main.tf @@ -54,5 +54,6 @@ module "wrapper" { spot_instance_interruption_behavior = try(each.value.spot_instance_interruption_behavior, var.defaults.spot_instance_interruption_behavior, null) spot_valid_until = try(each.value.spot_valid_until, var.defaults.spot_valid_until, null) spot_valid_from = try(each.value.spot_valid_from, var.defaults.spot_valid_from, null) + disable_api_stop = try(each.value.disable_api_stop, var.defaults.disable_api_stop, null) putin_khuylo = try(each.value.putin_khuylo, var.defaults.putin_khuylo, true) }