Commit 2e58e02f authored by Ryan Randles Jones's avatar Ryan Randles Jones
Browse files

Update main.tf

parent 7c84ad2c
resource "openstack_networking_network_v2" "network" {
# creates public and private keypair
resource "openstack_compute_keypair_v2" "test-keypair" {
name = "my-keypair"
}
provisioner "file" {
source = "network_create"
destination = "/network_create"
}
# creates dmznet
resource "openstack_networking_network_v2" "ohpc" {
name = "dmznet"
admin_state_up = "true"
}
provisioner "remote-exec" {
inline = [
"source network_create",
]
}
# creates dmzsubnet using the floating ip defined in datasources.tf to get the network id
# cidr is the subnet range (that subnet range and dns nameservers from the network create file in feat-openstack)
resource "openstack_networking_subnet_v2" "terraform" {
name = "dmzsubnet"
network_id = "${openstack_networking_network_v2.ohpc.id}"
cidr = "192.168.100.0/24"
ip_version = 4
dns_nameservers = ["8.8.8.8"]
}
# creates public and private keypair
resource "openstack_compute_keypair_v2" "test-keypair" {
name = "my-keypair"
# defines the router borderrouter using floating ip defined in datasources.tf to create the external network id
resource "openstack_networking_router_v2" "ohpc" {
name = "borderrouter"
admin_state_up = "true"
external_network_id = "${data.openstack_networking_network_v2.ohpc.id}"
}
# creates the router and subnet id using info defined above
resource "openstack_networking_router_interface_v2" "ohpc" {
router_id = "${openstack_networking_router_v2.ohpc.id}"
subnet_id = "${openstack_networking_subnet_v2.ohpc.id}"
}
# defines where floating ip will come from using variable from vars.tf
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment