/terraform-cloudfoundry-loki

Grafana Loki deployment for Cloud foundry

Primary LanguageHCLMIT LicenseMIT

terraform-cloudfoundry-loki

Deploys a Grafana Loki instance to Cloud foundry

Contact / Getting help

Please post your questions on the HSDP Slack #terraform channel

License

License is MIT

Requirements

Name Version
terraform >= 0.14.0
cloudfoundry >= 0.14.2
htpasswd >= 1.0.2
random >= 2.2.1

Providers

Name Version
cloudfoundry 0.53.1
random 3.6.1

Modules

Name Source Version
logdrain ./modules/logdrain n/a
proxy ./modules/proxy n/a

Resources

Name Type
cloudfoundry_app.loki resource
cloudfoundry_network_policy.loki resource
cloudfoundry_route.loki_internal resource
cloudfoundry_service_instance.s3 resource
cloudfoundry_service_key.s3 resource
random_id.id resource
random_password.token resource
cloudfoundry_domain.domain data source
cloudfoundry_domain.internal data source
cloudfoundry_service.s3 data source

Inputs

Name Description Type Default Required
caddy_image Caddy server image to use string "caddy/caddy:2.6.1" no
cf_domain The CF domain name to use string n/a yes
cf_space_id The CF Space to deploy in string n/a yes
disk The amount of Disk space to allocate for Grafana Loki (MB) number 4096 no
docker_password Docker registry password string "" no
docker_username Docker registry username string "" no
enable_cf_logdrain Enables creation of a Cloud foundry logdrain service bool false no
enable_public_proxy Enables an authenticated public proxy endpoint bool false no
environment Environment variables for Grafana Loki map(any) {} no
loki_cf_logdrain_image loki-cf-logdrain Docker image to use string "ghcr.io/philips-software/loki-cf-logdrain:v0.5.6" no
loki_image Loki Docker image to use string "grafana/loki:2.8.0" no
max_query_series Maximum query series number 500 no
memory The amount of RAM to allocate for Loki (MB) number 1024 no
name_postfix The postfix string to append to the hostname, prevents namespace clashes string "" no
network_policies The container-to-container network policies to create with Grafana as the source app
list(object({
destination_app = string
protocol = string
port = string
}))
[] no
s3_broker_settings The S3 service broker to use
object({
service_broker = string
service_plan = string
})
{
"service_broker": "hsdp-s3",
"service_plan": "s3_bucket"
}
no
s3_credentials n/a
object({
access_key = string
secret_key = string
endpoint = string
bucket = string
})
{
"access_key": "",
"bucket": "",
"endpoint": "",
"secret_key": ""
}
no

Outputs

Name Description
logdrain_endpoint The logproxy logdrain endpoint
logdrain_service_id The uuid of the logdrain service. You can bind this to your app to enable logdraining
loki_app_id The Loki app id
loki_endpoint The endpoint where Loki is reachable on
loki_proxy_endpoint The Loki proxy endpoint
loki_proxy_password The Loki proxy password. Username is always 'loki'
loki_proxy_username The Loki proxy password. Username is always 'loki'