Initial version
This commit is contained in:
commit
06367914c7
28
dtca.tf
Normal file
28
dtca.tf
Normal file
|
@ -0,0 +1,28 @@
|
|||
resource "openstack_networking_port_v2" "dtcaport" {
|
||||
name = "${dtcaname}-sunet-se-port"
|
||||
network_id = data.openstack_networking_network_v2.public.id
|
||||
# A list of security group ID
|
||||
security_group_ids = [
|
||||
data.openstack_networking_secgroup_v2.sshfromjumphosts.id,
|
||||
data.openstack_networking_secgroup_v2.allegress.id
|
||||
]
|
||||
admin_state_up = "true"
|
||||
lifecycle {
|
||||
prevent_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
resource "openstack_networking_port_v2" "dtcadbport" {
|
||||
name = "${dtcadbname}-sunet-se-port"
|
||||
network_id = data.openstack_networking_network_v2.public.id
|
||||
# A list of security group ID
|
||||
security_group_ids = [
|
||||
data.openstack_networking_secgroup_v2.sshfromjumphosts.id,
|
||||
data.openstack_networking_secgroup_v2.allegress.id
|
||||
]
|
||||
admin_state_up = "true"
|
||||
lifecycle {
|
||||
prevent_destroy = true
|
||||
}
|
||||
}
|
22
main.tf
Normal file
22
main.tf
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Define required providers
|
||||
terraform {
|
||||
required_version = ">= 0.14.0"
|
||||
required_providers {
|
||||
openstack = {
|
||||
source = "terraform-provider-openstack/openstack"
|
||||
version = "~> 1.53.0"
|
||||
}
|
||||
local = {
|
||||
source = "hashicorp/local"
|
||||
version = "2.4.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "openstack" {
|
||||
# Source application credentials to use environemnt variables to provide auth
|
||||
}
|
||||
|
||||
provider "local" {
|
||||
# Configuration options
|
||||
}
|
3
network.tf
Normal file
3
network.tf
Normal file
|
@ -0,0 +1,3 @@
|
|||
data "openstack_networking_network_v2" "public" {
|
||||
name = "sunet.se-public"
|
||||
}
|
8
securitygroups.tf
Normal file
8
securitygroups.tf
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Datasource of sunet ssh-from-jumphost security group.
|
||||
data "openstack_networking_secgroup_v2" "sshfromjumphosts" {
|
||||
name = "ssh-from-jumphost"
|
||||
}
|
||||
|
||||
data "openstack_networking_secgroup_v2" "allegress" {
|
||||
name = "Allow all outgoing"
|
||||
}
|
Loading…
Reference in a new issue