Skip to content

Commit

Permalink
Add cdn service instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Stretch96 committed Apr 19, 2021
1 parent 988a9ac commit ae94f9b
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 ae94f9b

Please sign in to comment.