fix(Terraform): Change AWS AZ
[csit.git] / fdio.infra.terraform / 3n_aws_c5n / deploy / main.tf
index 05c7e32..dd994cc 100644 (file)
@@ -127,17 +127,6 @@ resource "aws_subnet" "c" {
   }
 }
 
-resource "aws_subnet" "d" {
-  vpc_id            = aws_vpc.CSITVPC.id
-  cidr_block        = var.vpc_cidr_d
-  availability_zone = var.avail_zone
-  depends_on        = [aws_vpc.CSITVPC, aws_vpc_ipv4_cidr_block_association.d]
-
-  tags = {
-    "Environment" = var.environment_name
-  }
-}
-
 resource "aws_subnet" "d" {
   availability_zone               = var.avail_zone
   assign_ipv6_address_on_creation = false
@@ -154,6 +143,17 @@ resource "aws_subnet" "d" {
   }
 }
 
+resource "aws_internet_gateway" "CSITGW" {
+  depends_on = [
+    aws_vpc.CSITVPC
+  ]
+  vpc_id     = aws_vpc.CSITVPC.id
+
+  tags = {
+    "Environment" = var.environment_name
+  }
+}
+
 # SSH keypair
 # Temporary key for provisioning only
 resource "tls_private_key" "CSITTLS" {
@@ -223,15 +223,15 @@ resource "aws_network_interface" "dut2_if1" {
     aws_subnet.c,
     aws_instance.dut2
   ]
-  private_ip        = var.dut2_if2_ip
-  private_ips       = [var.dut2_if2_ip]
+  private_ip        = var.dut2_if1_ip
+  private_ips       = [var.dut2_if1_ip]
   security_groups   = [aws_security_group.CSITSG.id]
   source_dest_check = false
   subnet_id         = aws_subnet.c.id
 
   attachment {
     instance     = aws_instance.dut2.id
-    device_index = 2
+    device_index = 1
   }
 
   tags = {