Skip to content

Commit

Permalink
Merge pull request #269 from DFE-Digital/add-cdn-service-instance
Browse files Browse the repository at this point in the history
Add cdn service instance
  • Loading branch information
tahb authored Apr 19, 2021
2 parents 988a9ac + ae94f9b commit 9cc6b77
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions terraform/app/cdn.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
data "cloudfoundry_service" "cdn_route" {
name = "cdn-route"
}

resource "cloudfoundry_service_instance" "cdn_route" {
count = local.environment == "prod" ? 1 : (local.environment == "staging" ? 1 : 0)
name = local.environment == "prod" ? "get-help-buying-for-schools" : "get-help-buying-for-schools-staging"
space = data.cloudfoundry_space.space.id
service_plan = data.cloudfoundry_service.cdn_route.service_plans["cdn-route"]
json_params = jsonencode(
{
domain = "${local.custom_hostname}.${local.custom_cloudfoundry_domain}"
}
)
lifecycle {
prevent_destroy = true
}
}

0 comments on commit 9cc6b77

Please sign in to comment.