From 3ac90df3c1d3c920700a2a67445c649e492c626d Mon Sep 17 00:00:00 2001 From: Om Sharma Date: Fri, 16 Sep 2022 15:10:47 +0530 Subject: [PATCH] added hiberation tag --- _example/basic_example/example.tf | 1 + main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/_example/basic_example/example.tf b/_example/basic_example/example.tf index 9fc0245..2b801d4 100644 --- a/_example/basic_example/example.tf +++ b/_example/basic_example/example.tf @@ -145,6 +145,7 @@ module "ec2" { instance_type = "t2.nano" monitoring = false tenancy = "default" + hibernation = false #Networking vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids] diff --git a/main.tf b/main.tf index 5b43c76..5c2ae60 100644 --- a/main.tf +++ b/main.tf @@ -65,6 +65,7 @@ resource "aws_instance" "default" { source_dest_check = var.source_dest_check ipv6_address_count = var.ipv6_address_count ipv6_addresses = var.ipv6_addresses + hibernation = var.hibernation dynamic "root_block_device" { for_each = var.root_block_device diff --git a/variables.tf b/variables.tf index abbceb3..642f5c2 100644 --- a/variables.tf +++ b/variables.tf @@ -334,3 +334,9 @@ variable "metadata_http_put_response_hop_limit" { default = 2 description = "The desired HTTP PUT response hop limit (between 1 and 64) for instance metadata requests." } + +variable "hibernation" { + type = bool + default = false + description = "hibernate an instance, Amazon EC2 signals the operating system to perform hibernation." +} \ No newline at end of file