aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/terraform/aws/nic.tf
diff options
context:
space:
mode:
authorMaros Mullner <mamullne@cisco.com>2020-02-13 10:57:02 +0100
committerPeter Mikus <pmikus@cisco.com>2020-02-17 08:06:13 +0000
commit6bc0123c235171918a6193b1551ed4d4d82c2fec (patch)
treef21b0f8fa6d3ab765bb7c9acc7b549e1e64acc71 /resources/tools/terraform/aws/nic.tf
parent997a634a6658d3d07ff84fc54e156ebd805fec74 (diff)
AWS terraform automation scripts
Change-Id: I050fe466dd006d330d1bb29cc6ccba8ae4681f01 Signed-off-by: Maros Mullner <maros.mullner@pantheon.tech>
Diffstat (limited to 'resources/tools/terraform/aws/nic.tf')
-rw-r--r--resources/tools/terraform/aws/nic.tf101
1 files changed, 101 insertions, 0 deletions
diff --git a/resources/tools/terraform/aws/nic.tf b/resources/tools/terraform/aws/nic.tf
new file mode 100644
index 0000000000..31926e4abd
--- /dev/null
+++ b/resources/tools/terraform/aws/nic.tf
@@ -0,0 +1,101 @@
+resource "aws_network_interface" "dut1_if2" {
+ subnet_id = aws_subnet.c.id
+ source_dest_check = false
+ private_ip = var.dut1_if2_ip
+ private_ips = [var.dut1_if2_ip]
+ security_groups = [aws_security_group.CSIT.id]
+ attachment {
+ instance = aws_instance.dut1.id
+ device_index = 1
+ }
+ depends_on = [aws_vpc.CSIT]
+}
+
+data "aws_network_interface" "dut1_if2" {
+ id = aws_network_interface.dut1_if2.id
+}
+
+resource "aws_network_interface" "dut1_if1" {
+ subnet_id = aws_subnet.b.id
+ source_dest_check = false
+ private_ip = var.dut1_if1_ip
+ private_ips = [var.dut1_if1_ip]
+ security_groups = [aws_security_group.CSIT.id]
+ attachment {
+ instance = aws_instance.dut1.id
+ device_index = 2
+ }
+ depends_on = [aws_vpc.CSIT, aws_subnet.b]
+}
+
+data "aws_network_interface" "dut1_if1" {
+ id = aws_network_interface.dut1_if1.id
+}
+
+resource "aws_network_interface" "dut2_if1" {
+ subnet_id = aws_subnet.c.id
+ source_dest_check = false
+ private_ip = var.dut2_if1_ip
+ private_ips = [var.dut2_if1_ip]
+ security_groups = [aws_security_group.CSIT.id]
+ attachment {
+ instance = aws_instance.dut2.id
+ device_index = 1
+ }
+ depends_on = [aws_vpc.CSIT, aws_subnet.c]
+}
+
+data "aws_network_interface" "dut2_if1" {
+ id = aws_network_interface.dut2_if1.id
+}
+
+resource "aws_network_interface" "dut2_if2" {
+ subnet_id = aws_subnet.d.id
+ source_dest_check = false
+ private_ip = var.dut2_if2_ip
+ private_ips = [var.dut2_if2_ip]
+ security_groups = [aws_security_group.CSIT.id]
+ attachment {
+ instance = aws_instance.dut2.id
+ device_index = 2
+ }
+ depends_on = [aws_vpc.CSIT, aws_subnet.d]
+}
+
+data "aws_network_interface" "dut2_if2" {
+ id = aws_network_interface.dut2_if2.id
+}
+
+resource "aws_network_interface" "tg_if1" {
+ subnet_id = aws_subnet.b.id
+ source_dest_check = false
+ private_ip = var.tg_if1_ip
+ private_ips = [var.tg_if1_ip]
+ security_groups = [aws_security_group.CSIT.id]
+ attachment {
+ instance = aws_instance.tg.id
+ device_index = 1
+ }
+ depends_on = [aws_vpc.CSIT, aws_subnet.b]
+}
+
+data "aws_network_interface" "tg_if1" {
+ id = aws_network_interface.tg_if1.id
+}
+
+resource "aws_network_interface" "tg_if2" {
+ subnet_id = aws_subnet.d.id
+ source_dest_check = false
+ private_ip = var.tg_if2_ip
+ private_ips = [var.tg_if2_ip]
+ security_groups = [aws_security_group.CSIT.id]
+ attachment {
+ instance = aws_instance.tg.id
+ device_index = 2
+ }
+ depends_on = [aws_vpc.CSIT, aws_subnet.d]
+}
+
+data "aws_network_interface" "tg_if2" {
+ id = aws_network_interface.tg_if2.id
+}