From 11db06b916d93b564dce549800fd55125dbbecde Mon Sep 17 00:00:00 2001 From: Zachary Hill Date: Fri, 24 Nov 2023 09:34:45 -0700 Subject: [PATCH] Bug_vpc_eip_domain (#33) * converted all aws_eip resources to domain = "vpc" EC2 Classic has been deprecated. This changes all aws_eip resources to utilize the corrected domain = "vpc". * Continuous Integration - terraform fmt and terraform-docs * removed unnecessary arguments --------- Co-authored-by: zachreborn --- modules/aws/eip/README.md | 3 --- modules/aws/eip/main.tf | 2 +- modules/aws/eip/variables.tf | 6 ------ modules/aws/vendor/cato_sdwan/main.tf | 4 ++-- modules/aws/vendor/fortigate_firewall/main.tf | 4 ++-- modules/aws/vpc/main.tf | 4 ++-- modules/aws/vpc/variables.tf | 5 ----- modules/services/siem/main.tf | 4 ++-- 8 files changed, 9 insertions(+), 23 deletions(-) diff --git a/modules/aws/eip/README.md b/modules/aws/eip/README.md index f055f28e..4af0f962 100644 --- a/modules/aws/eip/README.md +++ b/modules/aws/eip/README.md @@ -68,7 +68,6 @@ module "public_ip" { source = "github.com/zachreborn/terraform-modules//modules/aws/eip" instance = module.web_server.id[0] - vpc = true } ``` @@ -79,7 +78,6 @@ module "website_eip" { associate_with_private_ip = "10.11.201.20" network_interface = module.fw.network_interface_id[0] - vpc = true } ``` @@ -121,7 +119,6 @@ No modules. | [instance](#input\_instance) | (Optional) EC2 instance ID. | `string` | `""` | no | | [network\_interface](#input\_network\_interface) | (Optional) Network interface ID to associate with. | `string` | `""` | no | | [tags](#input\_tags) | (Optional) A mapping of tags to assign to the resource. | `map(any)` | `{}` | no | -| [vpc](#input\_vpc) | (Optional) Boolean if the EIP is in a VPC or not. | `string` | `true` | no | ## Outputs diff --git a/modules/aws/eip/main.tf b/modules/aws/eip/main.tf index d8850a40..f4577d43 100644 --- a/modules/aws/eip/main.tf +++ b/modules/aws/eip/main.tf @@ -17,5 +17,5 @@ resource "aws_eip" "eip" { instance = var.instance network_interface = var.network_interface tags = var.tags - vpc = var.vpc + domain = "vpc" } diff --git a/modules/aws/eip/variables.tf b/modules/aws/eip/variables.tf index 2ad535a4..3648ec75 100644 --- a/modules/aws/eip/variables.tf +++ b/modules/aws/eip/variables.tf @@ -21,9 +21,3 @@ variable "tags" { description = "(Optional) A mapping of tags to assign to the resource." default = {} } - -variable "vpc" { - type = string - description = "(Optional) Boolean if the EIP is in a VPC or not." - default = true -} diff --git a/modules/aws/vendor/cato_sdwan/main.tf b/modules/aws/vendor/cato_sdwan/main.tf index d8df29a9..546948cc 100644 --- a/modules/aws/vendor/cato_sdwan/main.tf +++ b/modules/aws/vendor/cato_sdwan/main.tf @@ -77,8 +77,8 @@ resource "aws_security_group" "cato_lan_sg" { ############################################ resource "aws_eip" "wan_external_ip" { - vpc = true - count = var.number + count = var.number + domain = "vpc" } resource "aws_eip_association" "wan_external_ip" { diff --git a/modules/aws/vendor/fortigate_firewall/main.tf b/modules/aws/vendor/fortigate_firewall/main.tf index ddb98198..a5b91bad 100644 --- a/modules/aws/vendor/fortigate_firewall/main.tf +++ b/modules/aws/vendor/fortigate_firewall/main.tf @@ -37,8 +37,8 @@ resource "aws_security_group" "fortigate_fw_sg" { } resource "aws_eip" "external_ip" { - vpc = true - count = var.number + count = var.number + domain = "vpc" lifecycle { prevent_destroy = true diff --git a/modules/aws/vpc/main.tf b/modules/aws/vpc/main.tf index a299b54a..52924fba 100644 --- a/modules/aws/vpc/main.tf +++ b/modules/aws/vpc/main.tf @@ -211,8 +211,8 @@ resource "aws_route" "public_default_route" { } resource "aws_eip" "nateip" { - count = var.enable_nat_gateway ? (var.single_nat_gateway ? 1 : length(var.azs)) : 0 - vpc = true + count = var.enable_nat_gateway ? (var.single_nat_gateway ? 1 : length(var.azs)) : 0 + domain = "vpc" } resource "aws_nat_gateway" "natgw" { diff --git a/modules/aws/vpc/variables.tf b/modules/aws/vpc/variables.tf index 715f8397..40fa67b4 100644 --- a/modules/aws/vpc/variables.tf +++ b/modules/aws/vpc/variables.tf @@ -129,11 +129,6 @@ variable "public_propagating_vgws" { default = [] } -/* variable "vpc_region" { - description = "The region for the VPC" - type = string -} */ - variable "workspaces_propagating_vgws" { description = "A list of VGWs the workspaces route table should propagate." default = [] diff --git a/modules/services/siem/main.tf b/modules/services/siem/main.tf index 94727ee6..a1221afc 100644 --- a/modules/services/siem/main.tf +++ b/modules/services/siem/main.tf @@ -52,8 +52,8 @@ resource "aws_subnet" "public_subnets" { ########################### resource "aws_eip" "nateip" { - count = var.enable_nat_gateway ? (var.single_nat_gateway ? 1 : length(var.azs)) : 0 - vpc = true + count = var.enable_nat_gateway ? (var.single_nat_gateway ? 1 : length(var.azs)) : 0 + domain = "vpc" } resource "aws_internet_gateway" "igw" {