You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.2 KiB
Terraform

terraform {
backend "s3" {
bucket = "terraform-state"
key = "apps/landing-page/terraform.tfstate"
endpoint = "https://s3.ravianand.me"
region = "homelab01"
force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
}
required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.13.1"
}
postgresql = {
source = "cyrilgdn/postgresql"
version = "1.17.1"
}
}
}
provider "kubernetes" {
cluster_ca_certificate = base64decode(var.kubernetes_cluster_ca_certificate)
host = var.kubernetes_host
token = var.kubernetes_token
}
provider "postgresql" {
host = var.postgres_host
port = 5432
database = "postgres"
username = var.postgres_admin_user
password = var.postgres_admin_password
sslmode = var.postgres_sslmode
connect_timeout = 15
}
resource "postgresql_role" "strapi" {
name = var.postgres_user
login = true
password = var.postgres_password
}
resource "postgresql_database" "strapi" {
name = "strapi"
owner = postgresql_role.strapi.name
}