Skip to content

Commit

Permalink
Bug_vpc_eip_domain (#33)
Browse files Browse the repository at this point in the history
* 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 <zachreborn@users.noreply.github.com>
  • Loading branch information
zachreborn and zachreborn authored Nov 24, 2023
1 parent 0763353 commit 11db06b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 23 deletions.
3 changes: 0 additions & 3 deletions modules/aws/eip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ module "public_ip" {
source = "github.com/zachreborn/terraform-modules//modules/aws/eip"
instance = module.web_server.id[0]
vpc = true
}
```

Expand All @@ -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
}
```

Expand Down Expand Up @@ -121,7 +119,6 @@ No modules.
| <a name="input_instance"></a> [instance](#input\_instance) | (Optional) EC2 instance ID. | `string` | `""` | no |
| <a name="input_network_interface"></a> [network\_interface](#input\_network\_interface) | (Optional) Network interface ID to associate with. | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A mapping of tags to assign to the resource. | `map(any)` | `{}` | no |
| <a name="input_vpc"></a> [vpc](#input\_vpc) | (Optional) Boolean if the EIP is in a VPC or not. | `string` | `true` | no |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion modules/aws/eip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ resource "aws_eip" "eip" {
instance = var.instance
network_interface = var.network_interface
tags = var.tags
vpc = var.vpc
domain = "vpc"
}
6 changes: 0 additions & 6 deletions modules/aws/eip/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions modules/aws/vendor/cato_sdwan/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
4 changes: 2 additions & 2 deletions modules/aws/vendor/fortigate_firewall/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions modules/aws/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
5 changes: 0 additions & 5 deletions modules/aws/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
4 changes: 2 additions & 2 deletions modules/services/siem/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 11db06b

Please sign in to comment.