Skip to content

Commit

Permalink
feat: Add support for disable_api_stop (#218)
Browse files Browse the repository at this point in the history
* addition of disable api stop feature

* fix version constraints

Co-authored-by: Samuel CHNIBER <schniber@amazon.fr>
  • Loading branch information
schniber and Samuel CHNIBER authored Dec 15, 2022
1 parent e4474e1 commit 69415ea
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ Note: the default behavior of the module is to create an autoscaling group and l
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.20 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.14 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.20 |

## Modules

Expand Down Expand Up @@ -275,6 +275,7 @@ No modules.
| <a name="input_default_version"></a> [default\_version](#input\_default\_version) | Default Version of the launch template | `string` | `null` | no |
| <a name="input_delete_timeout"></a> [delete\_timeout](#input\_delete\_timeout) | Delete timeout to wait for destroying autoscaling group | `string` | `null` | no |
| <a name="input_desired_capacity"></a> [desired\_capacity](#input\_desired\_capacity) | The number of Amazon EC2 instances that should be running in the autoscaling group | `number` | `null` | no |
| <a name="input_disable_api_stop"></a> [disable\_api\_stop](#input\_disable\_api\_stop) | If true, enables EC2 instance stop protection | `bool` | `null` | no |
| <a name="input_disable_api_termination"></a> [disable\_api\_termination](#input\_disable\_api\_termination) | If true, enables EC2 instance termination protection | `bool` | `null` | no |
| <a name="input_ebs_optimized"></a> [ebs\_optimized](#input\_ebs\_optimized) | If true, the launched EC2 instance will be EBS-optimized | `bool` | `null` | no |
| <a name="input_elastic_gpu_specifications"></a> [elastic\_gpu\_specifications](#input\_elastic\_gpu\_specifications) | The elastic GPU to attach to the instance | `map(string)` | `{}` | no |
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.20 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.14 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.20 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.14"
version = ">= 4.20"
}
}
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ resource "aws_launch_template" "this" {
default_version = var.default_version
update_default_version = var.update_default_version
disable_api_termination = var.disable_api_termination
disable_api_stop = var.disable_api_stop
instance_initiated_shutdown_behavior = var.instance_initiated_shutdown_behavior
kernel_id = var.kernel_id
ram_disk_id = var.ram_disk_id
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ variable "disable_api_termination" {
default = null
}

variable "disable_api_stop" {
description = "If true, enables EC2 instance stop protection"
type = bool
default = null
}

variable "instance_initiated_shutdown_behavior" {
description = "Shutdown behavior for the instance. Can be `stop` or `terminate`. (Default: `stop`)"
type = string
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.14"
version = ">= 4.20"
}
}
}

0 comments on commit 69415ea

Please sign in to comment.