An opinionated Terraform module to provision an application and database very easily with Scalingo.
module "my_app" {
source = "scalingo-community/app/scalingo"
version = "0.3.2"
# 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, will be auto-configured for app and every addons
log_drains = [{ type = "elk", url = "https://user:password@logstash.example.com" }]
}
Used in production by :
Name | Version |
---|---|
terraform | >= 1.3.0, < 2.0.0 |
environment | ~> 1.3 |
scalingo | ~> 2.2 |
Name | Type |
---|---|
scalingo_addon.addons | resource |
scalingo_app.app | resource |
scalingo_autoscaler.autoscalers | resource |
scalingo_collaborator.collaborators | resource |
scalingo_container_type.containers | resource |
scalingo_domain.canonical_domain | resource |
scalingo_domain.domain_aliases | resource |
scalingo_log_drain.addons | resource |
scalingo_log_drain.app | resource |
scalingo_scm_repo_link.scm_repo_link | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
additionnal_collaborators | List of emails of collaborators that have admin rights for the application | list(string) |
[] |
no |
addons | List of addons to add to the application | list(object({ |
[] |
no |
authorize_unsecure_http | When true, Scalingo does not automatically redirect HTTP traffic to HTTPS. The default behavior is to redirect HTTP traffic to HTTPS (when value is false ) |
bool |
false |
no |
containers | Configuration of the containers of the application. | map(object({ |
{ |
no |
domain | Main domain name of the application, known as "canonical domain" in Scalingo's dashboard. Note that SSL configuration must be completed through the dashboard. | string |
null |
no |
domain_aliases | List of others domain names for the application | list(string) |
[] |
no |
environment | Map of environment variables to set on the application. Note that value of environment variables can be null or empty. | map(string) |
null |
no |
github_integration | Configuration of the GitHub integration of the application. Only one of github_integration or gitlab_integration can be set. | object({ |
null |
no |
gitlab_integration | Configuration of the GitLab integration of the application. Only one of github_integration or gitlab_integration can be set. | object({ |
null |
no |
log_drains | List of log_drain configuration to redirect logs from the application and addons to a log management service. Each configuration is automatically associated to the application and to every eligible addons. | list(object({ |
[] |
no |
name | Name of the application. Must be unique on Scalingo. | string |
n/a | yes |
review_apps | Configuration of the review apps of the application. | object({ |
{} |
no |
router_logs | When true, the router logs are included in the application logs. (default: false ) |
bool |
false |
no |
stack | The stack to use for the app (default: "scalingo-22"). | string |
"scalingo-22" |
no |
sticky_session | When true, sticky sessions are enabled. (default: false ) |
bool |
false |
no |
Name | Description |
---|---|
all_environment_variables | All environment variables of the Scalingo application (ones added by the terraform module and ones added by Scalingo add-ons). |
app_id | ID of the Scalingo application. |
domain | Hostname to use to access the application. Same as the url output but without the https:// . |
git_url | Hostname to use to deploy code with Git + SSH. |
origin_domain | The FQDN of the Scalingo application (<your_app_name>.<region>.scalingo.io ). Same as the domain output if you have not set a canonical domain. |
region | Region where the application is deployed. |
url | Base URL to access the application (https://* ). If you have set a canonical domain, this will be the URL with the canonical domain, otherwise it will be the default URL of the Scalingo application. |
This module use terraform-docs
to auto-generate its documentation. You can use it without installing it thanks to this docker
command :
docker run --rm -v "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.16.0 markdown table /terraform-docs