Skip to content

Instantly share code, notes, and snippets.

@carlpett
Created June 8, 2016 16:49
Show Gist options
  • Save carlpett/67a27c374aed8a3302fd2729d6ba7a82 to your computer and use it in GitHub Desktop.
Save carlpett/67a27c374aed8a3302fd2729d6ba7a82 to your computer and use it in GitHub Desktop.
resource "openstack_networking_network_v2" "test-net" {
name = "test-net"
}
resource "openstack_networking_subnet_v2" "test-subnet" {
name ="test-subnet"
network_id = "${openstack_networking_network_v2.test-net.id}"
cidr = "10.1.2.0/24"
}
resource "openstack_networking_port_v2" "test-port" {
name = "test-port"
network_id = "${openstack_networking_network_v2.test-net.id}"
admin_state_up = "true"
fixed_ip {
subnet_id = "${openstack_networking_subnet_v2.test-subnet.id}"
}
fixed_ip {
subnet_id = "${openstack_networking_subnet_v2.test-subnet.id}"
}
}
resource "openstack_compute_instance_v2" "test-instance" {
name = "test-instance"
image_name = "centos-7-1601"
flavor_name = "m1.small"
security_groups = ["default", "terraform-test", "terraform-test2"]
network {
port = "${openstack_networking_port_v2.test-port.id}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment