@@ -1399,3 +1399,100 @@ resource "ibm_is_image_deprecate" "example" {
13991399resource "ibm_is_image_obsolete" "example" {
14001400 image = ibm_is_image. image1 . id
14011401}
1402+
1403+
1404+ // vni
1405+
1406+ resource "ibm_is_vpc" "testacc_vpc" {
1407+ name = " ${ var . name } -vpc"
1408+ }
1409+
1410+ resource "ibm_is_subnet" "testacc_subnet" {
1411+ name = " ${ var . name } -subnet"
1412+ vpc = ibm_is_vpc. testacc_vpc . id
1413+ zone = " ${ var . region } -2"
1414+ total_ipv4_address_count = 16
1415+
1416+ }
1417+
1418+ resource "ibm_is_virtual_network_interface" "testacc_vni" {
1419+ name = " ${ var . name } "
1420+ subnet = ibm_is_subnet. testacc_subnet . id
1421+ enable_infrastructure_nat = true
1422+ allow_ip_spoofing = true
1423+ }
1424+
1425+ resource "ibm_is_floating_ip" "testacc_floatingip" {
1426+ name = " ${ var . name } -floating"
1427+ zone = ibm_is_subnet. testacc_subnet . zone
1428+ }
1429+ resource "ibm_is_virtual_network_interface_floating_ip" "testacc_vni_floatingip" {
1430+ virtual_network_interface = ibm_is_virtual_network_interface. testacc_vni . id
1431+ floating_ip = ibm_is_floating_ip. testacc_floatingip . id
1432+ }
1433+ data "ibm_is_virtual_network_interface_floating_ip" "is_vni_floating_ip" {
1434+ depends_on = [ ibm_is_virtual_network_interface_floating_ip . testacc_vni_floatingip ]
1435+ virtual_network_interface = ibm_is_virtual_network_interface. testacc_vni . id
1436+ floating_ip = ibm_is_floating_ip. testacc_floatingip . id
1437+ }
1438+ data "ibm_is_virtual_network_interface_floating_ips" "is_vni_floating_ips" {
1439+ depends_on = [ ibm_is_virtual_network_interface_floating_ip . testacc_vni_floatingip ]
1440+ virtual_network_interface = ibm_is_virtual_network_interface. testacc_vni . id
1441+ }
1442+
1443+ data "ibm_is_virtual_network_interface_ips" "is_vni_reservedips" {
1444+ depends_on = [ ibm_is_virtual_network_interface_ip . testacc_vni_reservedip ]
1445+ virtual_network_interface = ibm_is_virtual_network_interface. testacc_vni . id
1446+ }
1447+ data "ibm_is_virtual_network_interface_ip" "is_vni_reservedip" {
1448+ depends_on = [ ibm_is_virtual_network_interface_ip . testacc_vni_reservedip ]
1449+ virtual_network_interface = ibm_is_virtual_network_interface. testacc_vni . id
1450+ reserved_ip = ibm_is_subnet_reserved_ip. testacc_reservedip . reserved_ip
1451+ }
1452+
1453+ resource "ibm_is_subnet_reserved_ip" "testacc_reservedip" {
1454+ subnet = ibm_is_subnet. testacc_subnet . id
1455+ name = " ${ var . name } -reserved-ip"
1456+ }
1457+ resource "ibm_is_virtual_network_interface_ip" "testacc_vni_reservedip" {
1458+ virtual_network_interface = ibm_is_virtual_network_interface. testacc_vni . id
1459+ reserved_ip = ibm_is_subnet_reserved_ip. testacc_reservedip . reserved_ip
1460+ }
1461+
1462+ resource "ibm_is_virtual_network_interface" "testacc_vni2" {
1463+ name = " ${ var . name } -2"
1464+ subnet = ibm_is_subnet. testacc_subnet . id
1465+ enable_infrastructure_nat = true
1466+ allow_ip_spoofing = true
1467+ }
1468+ resource "ibm_is_virtual_network_interface" "testacc_vni3" {
1469+ name = " ${ var . name } -3"
1470+ subnet = ibm_is_subnet. testacc_subnet . id
1471+ enable_infrastructure_nat = true
1472+ allow_ip_spoofing = true
1473+ }
1474+ resource "ibm_is_ssh_key" "testacc_sshkey" {
1475+ name = " ${ var . name } -ssh"
1476+ public_key = file (" ~/.ssh/id_rsa.pub" )
1477+ }
1478+ resource "ibm_is_instance_network_attachment" "ina" {
1479+ instance = ibm_is_instance. ins . id
1480+ name = " viability-undecided-jalapeno-unbuilt"
1481+ virtual_network_interface {
1482+ id = ibm_is_virtual_network_interface. testacc_vni2 . id
1483+ }
1484+ }
1485+ resource "ibm_is_instance" "ins" {
1486+ name = " ${ var . name } -vsi2"
1487+ profile = " bx2-2x8"
1488+ image = " r134-f47cc24c-e020-4db5-ad96-1e5be8b5853b"
1489+ primary_network_attachment {
1490+ name = " vni-test"
1491+ virtual_network_interface {
1492+ id = ibm_is_virtual_network_interface. testacc_vni3 . id
1493+ }
1494+ }
1495+ vpc = ibm_is_vpc. testacc_vpc . id
1496+ zone = " ${ var . region } -2"
1497+ keys = [ibm_is_ssh_key . testacc_sshkey . id ]
1498+ }
0 commit comments