From eda67ef8ffe280326b01d76a131bbe5b07be62e3 Mon Sep 17 00:00:00 2001 From: Joseph Page Date: Sat, 16 Sep 2023 13:31:40 +0200 Subject: [PATCH] docs: add example usage in README --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89ca046..66868bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,42 @@ # Terraform Module for Scalingo App -An opinionated Terraform module to provision an application and database very easily with Scalingo +An opinionated Terraform module to provision an application and database very easily with Scalingo. + +## Example usage + +```tf +module "my_app" { + source = "scalingo-community/app/scalingo" + + # Configure the name and the canonical domain of the application + name = "my-app" + domain = "my-app.example.com" + + # Define environment variables + environment = { + FOO = "bar" + } + + # Configure size and amount of containers "web" + containers = { + web = { + size = "S" + amount = 2 + } + } + + # Attach a free PostgreSQL database + addons = [{ provider = "postgresql", plan = "postgresql-sandbox" }] + + # Configure log drains + log_drains = [{ type = "elk", url = "https://user:password@logstash.example.com" }] +} +``` + +## Community + +Used in production by : +- [1jeune1solution.gouv.fr](https://1jeune1solution.gouv.fr). ([source code](https://github.com/DNUM-SocialGouv/1j1s-front/blob/main/terraform/front.tf)) ## Requirements