Skip to content

Commit

Permalink
Add space for external-domain-broker tests (#873)
Browse files Browse the repository at this point in the history
* break up TF code into named files

* add space for external domain broker tests

* add new org for acceptance tests
  • Loading branch information
markdboyd authored Jul 8, 2024
1 parent 14ea0fe commit 7dacea5
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 152 deletions.
152 changes: 0 additions & 152 deletions terraform/stack/asg.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
}
10 changes: 10 additions & 0 deletions terraform/stack/iso.tf
Original file line number Diff line number Diff line change
@@ -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
]
}
15 changes: 15 additions & 0 deletions terraform/stack/orgs.tf
Original file line number Diff line number Diff line change
@@ -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"
}
20 changes: 20 additions & 0 deletions terraform/stack/quotas.tf
Original file line number Diff line number Diff line change
@@ -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
}
126 changes: 126 additions & 0 deletions terraform/stack/spaces.tf
Original file line number Diff line number Diff line change
@@ -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,
]
}

0 comments on commit 7dacea5

Please sign in to comment.