### Enable Portainer Plugin Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md Example of how to enable the Portainer plugin by setting the USE_PORTAINER variable in dotenv.tf. This controls the download and provisioning of the Portainer image and container. ```terraform variable "USE_PORTAINER" { type = bool default = true description = "Set default to true if you want to add Portainer to the deployment" } ``` -------------------------------- ### Terraform Initialization and Deployment Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md Commands to initialize Terraform, plan changes, apply the configuration to deploy the Supabase stack, and destroy the resources when no longer needed. Ensure you have Docker and Terraform CLI installed. ```shell terraform init terraform plan terraform apply terraform destroy ``` -------------------------------- ### Terraform Cleanup Instructions Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md Steps to remove Terraform dependencies and state files if encountering errors or needing a clean slate. This helps resolve issues related to corrupted state or incomplete installations. ```shell rm -rf .terraform/ rm -f terraform.tfstate rm -f terraform.tfstate.backup rm -f terraform.lock.hcl ``` -------------------------------- ### Terraform Configuration File Renaming Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md Instructions for renaming example configuration files to activate sensitive environment variables for Supabase and plugins. These files should not be committed to version control. ```shell mv ./supabase/definitions/dotenv.tf.example ./supabase/definitions/dotenv.tf mv ./plugins/defintions/dotenv.tf.example ./plugins/definitions/dotenv.tf mv ./supabase/definitions/thirdpartyauth.dotenv.tf.example ./supabase/definitions/thirdpartyauth.dotenv.tf ``` -------------------------------- ### Define Docker Resources for New Plugin Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md Example Terraform resources for a new plugin, including docker_image and docker_container. The 'count' property is crucial, set to 1 if the plugin variable is true, and 0 otherwise. ```terraform resource "docker_image" "plugin" { name = "myorganisation/plugin:latest" keep_locally = true count = var.USE_PLUGIN ? 1 : 0 } resource "docker_container" "plugin" { count = var.USE_PLUGIN ? 1 : 0 image = "myorganisation/plugin:latest" name = "plugin" ports { internal = 11111 external = 11111 } } ``` -------------------------------- ### Kong Configuration Template Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md A Terraform template file for Kong configuration, used by the Supabase API. It includes template variables that are replaced during deployment, such as API URLs and authentication keys. ```yaml --- _format_version: "1.1" _transform: "append" plugins: - name: "request-transformer" config: add: headers: - "X-Forwarded-Host: ${META_URL}" - "X-Forwarded-Port: ${META_PORT}" - "X-Forwarded-Proto: https" - "X-Real-IP: 127.0.0.1" - "X-Anon-Key: ${ANON_KEY}" - "X-Service-Role-Key: ${SECRET_KEY}" services: - name: "api" url: "http://localhost:8000" plugins: - name: "request-transformer" config: add: headers: - "X-Forwarded-Host: ${META_URL}" - "X-Forwarded-Port: ${META_PORT}" - "X-Forwarded-Proto: https" - "X-Real-IP: 127.0.0.1" - "X-Anon-Key: ${ANON_KEY}" - "X-Service-Role-Key: ${SECRET_KEY}" ``` -------------------------------- ### Define New Plugin Toggle Variable Source: https://github.com/supabase-community/supabase-terraform/blob/main/README.md Adds a new boolean variable to control the enablement of a custom plugin in Terraform. The default value should be false, indicating that plugins are optional and disabled by default. ```terraform variable "USE_PLUGIN" { type = bool default = false description = "Set default to true if you want to add to the deployment" } ``` -------------------------------- ### Securely Ignore PEM Files in Git Source: https://github.com/supabase-community/supabase-terraform/blob/main/plugins/definitions/volumes/nginxconfig/ssl/add_ssl_certs_here.md This snippet demonstrates how to configure your .gitignore file to prevent sensitive SSL certificate and key files from being committed to your source control repository. ```gitignore # Ignore SSL certificate and key files *.pem ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.