Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fshuva committed Oct 22, 2024
1 parent e7f1076 commit 2953a62
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
19 changes: 10 additions & 9 deletions instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ resource "ibm_is_instance" "fgt1" {
image = ibm_is_image.vnf_custom_image.id
profile = var.profile

primary_network_interface {
name = "${var.cluster_name}-port1-${random_string.random_suffix.result}"
subnet = data.ibm_is_subnet.subnet1.id
security_groups = [data.ibm_is_security_group.fgt_security_group.id]
primary_network_attachment {
name = "${var.CLUSTER_NAME}-fgt-port1-${random_string.random_suffix.result}"
virtual_network_interface {
id = ibm_is_virtual_network_interface.vni-passive["interface1"].id
}
}

network_interfaces {
name = "${var.cluster_name}-port2-${random_string.random_suffix.result}"
subnet = data.ibm_is_subnet.subnet2.id
security_groups = [data.ibm_is_security_group.fgt_security_group.id]
network_attachments {
name = "${var.CLUSTER_NAME}-fgt-port2-${random_string.random_suffix.result}"
virtual_network_interface {
id = ibm_is_virtual_network_interface.vni-passive["interface2"].id
}
}

volumes = [ibm_is_volume.logDisk.id]
Expand Down
4 changes: 2 additions & 2 deletions provider.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
terraform {
required_version = "> 1.1.0"
required_version = "> 1.6.0"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "~> 1.40.1"
version = "~> 1.68.0"
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,24 @@ data "ibm_is_subnet" "subnet2" {
data "ibm_is_security_group" "fgt_security_group" {
name = var.security_group
}

resource "ibm_is_virtual_network_interface" "vni-active" {
depends_on = [ ibm_is_instance.fgt1 ]
name = "${var.CLUSTER_NAME}-fgt-interface1-${random_string.random_suffix.result}"
allow_ip_spoofing = false
auto_delete = false
enable_infrastructure_nat = true
security_groups = [data.ibm_is_security_group.fgt_security_group.id]
subnet = data.ibm_is_subnet.subnet1.id

}

resource "ibm_is_virtual_network_interface" "vni-passive" {
depends_on = [ ibm_is_instance.fgt1 ]
name = "${var.CLUSTER_NAME}-fgt-interface2-${random_string.random_suffix.result}"
allow_ip_spoofing = false
auto_delete = false
enable_infrastructure_nat = true
subnet = data.ibm_is_subnet.subnet2.id

}

0 comments on commit 2953a62

Please sign in to comment.