Created
September 7, 2019 00:45
-
-
Save styk-tv/8580721050dfc66eac3275d51eaab41e to your computer and use it in GitHub Desktop.
openstack create port for instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "openstack_networking_network_v2" "network_1" { | |
name = "network_1" | |
} | |
resource "openstack_networking_subnet_v2" "subnet_1" { | |
name = "subnet_1" | |
network_id = "${openstack_networking_network_v2.network_1.id}" | |
cidr = "192.168.1.0/24" | |
ip_version = 4 | |
enable_dhcp = true | |
} | |
resource "openstack_networking_port_v2" "port_1" { | |
/* | |
depends_on = [ | |
"openstack_networking_subnet_v2.subnet_1", | |
] | |
*/ | |
name = "port_1" | |
network_id = "${openstack_networking_network_v2.network_1.id}" | |
admin_state_up = "true" | |
} | |
resource "openstack_compute_instance_v2" "instance_1" { | |
name = "instance_1" | |
network { | |
port = "${openstack_networking_port_v2.port_1.id}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment