diff --git a/terraform/stack/asg.tf b/terraform/stack/asg.tf index e1b9484c..a4cd111e 100644 --- a/terraform/stack/asg.tf +++ b/terraform/stack/asg.tf @@ -338,155 +338,3 @@ resource "cloudfoundry_default_asg" "staging" { ] } -resource "cloudfoundry_org_quota" "default-tts" { - name = "default-tts" - allow_paid_service_plans = true - total_memory = 81920 - total_routes = 1000 - total_services = 200 - total_route_ports = -1 -} - -resource "cloudfoundry_org" "cloud-gov" { - name = "cloud-gov" - quota = cloudfoundry_org_quota.default-tts.id -} - -resource "cloudfoundry_isolation_segment" "platform" { - name = "platform" -} - -resource "cloudfoundry_isolation_segment_entitlement" "platform" { - segment = cloudfoundry_isolation_segment.platform.id - orgs = [ - cloudfoundry_org.cloud-gov.id - ] -} - -resource "cloudfoundry_space" "services" { - name = "services" - org = cloudfoundry_org.cloud-gov.id - asgs = [ - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.dns.id, - cloudfoundry_asg.brokers.id, - cloudfoundry_asg.smtp.id, - ] - staging_asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - ] - isolation_segment = cloudfoundry_isolation_segment.platform.id -} - -resource "cloudfoundry_space" "dashboard" { - name = "dashboard" - org = cloudfoundry_org.cloud-gov.id - asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - cloudfoundry_asg.smtp.id, - ] - staging_asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - ] -} - -resource "cloudfoundry_space" "cg-ui" { - name = "cg-ui" - org = cloudfoundry_org.cloud-gov.id - asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - cloudfoundry_asg.smtp.id, - ] - staging_asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - ] -} - -resource "cloudfoundry_space" "uaa-extras" { - name = "uaa-extras" - org = cloudfoundry_org.cloud-gov.id - asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - cloudfoundry_asg.smtp.id, - ] - staging_asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - ] -} - -resource "cloudfoundry_space" "cspr-collector" { - name = "cspr-collector" - org = cloudfoundry_org.cloud-gov.id - asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - cloudfoundry_asg.smtp.id, - ] - staging_asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - ] -} - -resource "cloudfoundry_space" "opensearch-dashboards-proxy" { - name = "opensearch-dashboards-proxy" - org = cloudfoundry_org.cloud-gov.id - asgs = [ - cloudfoundry_asg.public_networks_egress.id, - cloudfoundry_asg.dns.id, - ] - staging_asgs = [ - cloudfoundry_asg.dns.id, - ] -} - -# Federalist/Pages - -data "cloudfoundry_org" "gsa-18f-federalist" { - name = "gsa-18f-federalist" -} - -resource "cloudfoundry_space_quota" "tiny" { - name = "tiny-tf-managed" - allow_paid_service_plans = true - total_memory = 1024 - total_routes = -1 - total_services = -1 - total_route_ports = -1 - org = data.cloudfoundry_org.gsa-18f-federalist.id -} - -resource "cloudfoundry_space" "email" { - name = "email" - org = data.cloudfoundry_org.gsa-18f-federalist.id - quota = cloudfoundry_space_quota.tiny.id - asgs = [ - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - cloudfoundry_asg.smtp.id, - ] - staging_asgs = [ - cloudfoundry_asg.trusted_local_networks.id, - cloudfoundry_asg.public_networks.id, - cloudfoundry_asg.dns.id, - ] -} diff --git a/terraform/stack/iso.tf b/terraform/stack/iso.tf new file mode 100644 index 00000000..e48aa5d3 --- /dev/null +++ b/terraform/stack/iso.tf @@ -0,0 +1,10 @@ +resource "cloudfoundry_isolation_segment" "platform" { + name = "platform" +} + +resource "cloudfoundry_isolation_segment_entitlement" "platform" { + segment = cloudfoundry_isolation_segment.platform.id + orgs = [ + cloudfoundry_org.cloud-gov.id + ] +} diff --git a/terraform/stack/orgs.tf b/terraform/stack/orgs.tf new file mode 100644 index 00000000..f5c166f7 --- /dev/null +++ b/terraform/stack/orgs.tf @@ -0,0 +1,15 @@ +resource "cloudfoundry_org" "cloud-gov" { + name = "cloud-gov" + quota = cloudfoundry_org_quota.default-tts.id +} + +resource "cloudfoundry_org" "acceptance_tests" { + name = "cloud-gov-acceptance-tests" + quota = cloudfoundry_org_quota.default-tts.id +} + +# Federalist/Pages + +data "cloudfoundry_org" "gsa-18f-federalist" { + name = "gsa-18f-federalist" +} diff --git a/terraform/stack/quotas.tf b/terraform/stack/quotas.tf new file mode 100644 index 00000000..5cd7759e --- /dev/null +++ b/terraform/stack/quotas.tf @@ -0,0 +1,20 @@ +resource "cloudfoundry_org_quota" "default-tts" { + name = "default-tts" + allow_paid_service_plans = true + total_memory = 81920 + total_routes = 1000 + total_services = 200 + total_route_ports = -1 +} + +# Federalist/ Pages + +resource "cloudfoundry_space_quota" "tiny" { + name = "tiny-tf-managed" + allow_paid_service_plans = true + total_memory = 1024 + total_routes = -1 + total_services = -1 + total_route_ports = -1 + org = data.cloudfoundry_org.gsa-18f-federalist.id +} diff --git a/terraform/stack/spaces.tf b/terraform/stack/spaces.tf new file mode 100644 index 00000000..a43b7287 --- /dev/null +++ b/terraform/stack/spaces.tf @@ -0,0 +1,126 @@ +resource "cloudfoundry_space" "services" { + name = "services" + org = cloudfoundry_org.cloud-gov.id + asgs = [ + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.dns.id, + cloudfoundry_asg.brokers.id, + cloudfoundry_asg.smtp.id, + ] + staging_asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] + isolation_segment = cloudfoundry_isolation_segment.platform.id +} + +resource "cloudfoundry_space" "dashboard" { + name = "dashboard" + org = cloudfoundry_org.cloud-gov.id + asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + cloudfoundry_asg.smtp.id, + ] + staging_asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] +} + +resource "cloudfoundry_space" "cg-ui" { + name = "cg-ui" + org = cloudfoundry_org.cloud-gov.id + asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + cloudfoundry_asg.smtp.id, + ] + staging_asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] +} + +resource "cloudfoundry_space" "uaa-extras" { + name = "uaa-extras" + org = cloudfoundry_org.cloud-gov.id + asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + cloudfoundry_asg.smtp.id, + ] + staging_asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] +} + +resource "cloudfoundry_space" "cspr-collector" { + name = "cspr-collector" + org = cloudfoundry_org.cloud-gov.id + asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + cloudfoundry_asg.smtp.id, + ] + staging_asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] +} + +resource "cloudfoundry_space" "opensearch-dashboards-proxy" { + name = "opensearch-dashboards-proxy" + org = cloudfoundry_org.cloud-gov.id + asgs = [ + cloudfoundry_asg.public_networks_egress.id, + cloudfoundry_asg.dns.id, + ] + staging_asgs = [ + cloudfoundry_asg.dns.id, + ] +} + +resource "cloudfoundry_space" "external_domain_broker_tests" { + name = "external-domain-broker-tests" + org = cloudfoundry_org.acceptance_tests.id + asgs = [ + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] + staging_asgs = [ + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] +} + +# Federalist/ Pages + +resource "cloudfoundry_space" "email" { + name = "email" + org = data.cloudfoundry_org.gsa-18f-federalist.id + quota = cloudfoundry_space_quota.tiny.id + asgs = [ + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + cloudfoundry_asg.smtp.id, + ] + staging_asgs = [ + cloudfoundry_asg.trusted_local_networks.id, + cloudfoundry_asg.public_networks.id, + cloudfoundry_asg.dns.id, + ] +}