Add stackit dns
This commit is contained in:
parent
f7a0c2bab3
commit
812d3e69f5
4 changed files with 30 additions and 3 deletions
|
|
@ -8,4 +8,5 @@ docker_username = "<DOCKER-USERNAME>"
|
||||||
docker_password = "<DOCKER-PASSWORD>"
|
docker_password = "<DOCKER-PASSWORD>"
|
||||||
cf_app_name = "<NAME-OFF-YOUR-APP>"
|
cf_app_name = "<NAME-OFF-YOUR-APP>"
|
||||||
cf_org_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-ORGANIZATION>"
|
cf_org_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-ORGANIZATION>"
|
||||||
cf_space_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-SPACE>"
|
cf_space_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-SPACE>"
|
||||||
|
app_domain = "<YOUR-APP-DOMAIN>"
|
||||||
14
terraform/dns.tf
Normal file
14
terraform/dns.tf
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
resource "stackit_dns_zone" "cloudfoundry-tf" {
|
||||||
|
dns_name = "cloudfoundry-tf.stackit.gg"
|
||||||
|
name = "cloudfoundry-tf"
|
||||||
|
project_id = var.project_id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "stackit_dns_record_set" "versatiles" {
|
||||||
|
name = var.app_domain
|
||||||
|
type = "ALIAS"
|
||||||
|
project_id = var.project_id
|
||||||
|
zone_id = stackit_dns_zone.cloudfoundry-tf.zone_id
|
||||||
|
# the alias record must point to cf api url
|
||||||
|
records = ["console.apps.01.cf.eu01.stackit.cloud."]
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,11 @@ data "cloudfoundry_space" "space" {
|
||||||
org = data.cloudfoundry_org.org.id
|
org = data.cloudfoundry_org.org.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "cloudfoundry_domain" "versatiles" {
|
||||||
|
name = var.app_domain
|
||||||
|
org = data.cloudfoundry_org.org.id
|
||||||
|
}
|
||||||
|
|
||||||
resource "cloudfoundry_app" "versatiles" {
|
resource "cloudfoundry_app" "versatiles" {
|
||||||
name = var.cf_app_name
|
name = var.cf_app_name
|
||||||
space_name = data.cloudfoundry_space.space.name
|
space_name = data.cloudfoundry_space.space.name
|
||||||
|
|
@ -18,8 +23,10 @@ resource "cloudfoundry_app" "versatiles" {
|
||||||
health_check_type = "http"
|
health_check_type = "http"
|
||||||
health_check_http_endpoint = "/"
|
health_check_http_endpoint = "/"
|
||||||
docker_image = var.docker_image
|
docker_image = var.docker_image
|
||||||
random_route = true
|
routes = [{
|
||||||
strategy = "rolling"
|
route = cloudfoundry_domain.versatiles.name
|
||||||
|
}]
|
||||||
|
strategy = "rolling"
|
||||||
docker_credentials = {
|
docker_credentials = {
|
||||||
username = var.docker_username
|
username = var.docker_username
|
||||||
password = var.docker_password
|
password = var.docker_password
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,11 @@ variable "cf_app_name" {
|
||||||
default = "versatiles"
|
default = "versatiles"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "app_domain" {
|
||||||
|
type = string
|
||||||
|
description = "FQDN for the versatiles app."
|
||||||
|
}
|
||||||
|
|
||||||
variable "tiles_url" {
|
variable "tiles_url" {
|
||||||
type = string
|
type = string
|
||||||
description = "The url of the tiles file."
|
description = "The url of the tiles file."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue