Create an example var file

This commit is contained in:
Daniel_Groß 2025-09-05 09:53:44 +02:00
parent 377450a663
commit 081a0c36bf
Signed by: daniel.gross
SSH key fingerprint: SHA256:tyyj1WVL1JmKHP6+jZjOtTzMj9U13qRk7jUcGI/zkRQ
5 changed files with 16 additions and 19 deletions

View file

@ -62,20 +62,6 @@ In order to create Cloud Foundry resources automatically, you will need a servic
### Deployment
Change to the `terraform` directory.
Create a `.tfvars` file and insert the required terraform variables, see [variables.tf](./terraform/variables.tf):
```
project_id = "<YOUR-PROJECT-ID>"
service_account_key_path = "<PATH-TO-YOUR-SA-KEY>"
cf_user = "<CLOUD-FOUNDRY-USER-MAIL>"
cf_password = "<CLOUD-FOUNDRY-USER-PASSWORD>"
tiles_url = "<https://<YOUR-BUCKET>.object.storage.eu01.onstackit.cloud/osm.versatiles>"
docker_image = "<DOCKER-IMAGE-URL>"
docker_username = "<DOCKER-USERNAME>"
docker_password = "<DOCKER-PASSWORD>"
cf_app_name = "<NAME-OFF-YOUR-APP>"
cf_org_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-ORGANIZATION>"
cf_space_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-SPACE>"
```
Create a `.tfvars` file and insert the required terraform variables, see [.tfvars.example](./terraform/.tfvars.example):
Call `terraform apply --var-file=<PATH-TO-TFVARS-FILE>`.

11
terraform/.tfvars.example Normal file
View file

@ -0,0 +1,11 @@
project_id = "<YOUR-PROJECT-ID>"
service_account_key_path = "<PATH-TO-YOUR-SA-KEY>"
cf_user = "<CLOUD-FOUNDRY-USER-MAIL>"
cf_password = "<CLOUD-FOUNDRY-USER-PASSWORD>"
tiles_url = "<https://<YOUR-BUCKET>.object.storage.eu01.onstackit.cloud/osm.versatiles>"
docker_image = "<DOCKER-IMAGE-URL>"
docker_username = "<DOCKER-USERNAME>"
docker_password = "<DOCKER-PASSWORD>"
cf_app_name = "<NAME-OFF-YOUR-APP>"
cf_org_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-ORGANIZATION>"
cf_space_name = "<NAME-OF-YOUR-CLOUD-FOUNDRY-SPACE>"

View file

@ -18,10 +18,10 @@ resource "cloudfoundry_app" "versatiles" {
health_check_type = "http"
health_check_http_endpoint = "/"
docker_image = var.docker_image
random_route = true
strategy = "rolling"
docker_credentials = {
username = var.docker_username
password = var.docker_password
}
random_route = true
strategy = "rolling"
}

View file

@ -16,7 +16,7 @@ provider "stackit" {
}
provider "cloudfoundry" {
api_url = "https://api.system.01.cf.eu01.stackit.cloud"
api_url = "https://api.system.01.cf.eu01.stackit.cloud"
user = var.cf_user
password = var.cf_password
}

View file

@ -6,7 +6,7 @@ variable "project_id" {
variable "service_account_key_path" {
type = string
description = "Path to your service account key."
sensitive = true
sensitive = true
}
variable "cf_user" {