diff --git a/app.tf b/app.tf index c0a588f..43c205c 100644 --- a/app.tf +++ b/app.tf @@ -9,6 +9,11 @@ resource "scalingo_app" "app" { stack_id = data.scalingo_stack.stack.id force_https = !var.authorize_unsecure_http + + # router_logs and sticky_sessions are not yet supported by the provider, but will be in the future + # see https://github.com/Scalingo/terraform-provider-scalingo/issues/158 for tracking progress + # sticky_sessions = var.sticky_sessions + # router_logs = var.router_logs } resource "scalingo_container_type" "containers" { diff --git a/scm_integration.tf b/scm_integration.tf index ec17502..de906c0 100644 --- a/scm_integration.tf +++ b/scm_integration.tf @@ -28,13 +28,14 @@ resource "scalingo_scm_repo_link" "scm_repo_link" { : data.scalingo_scm_integration.scm_integration[each.key].id ) - auto_deploy_enabled = each.value.auto_deploy_enabled - branch = each.value.branch - delete_on_close_enabled = each.value.delete_on_close_enabled - delete_stale_enabled = each.value.delete_stale_enabled - deploy_review_apps_enabled = each.value.deploy_review_apps_enabled - hours_before_delete_on_close = each.value.hours_before_delete_on_close - hours_before_delete_stale = each.value.hours_before_delete_stale + auto_deploy_enabled = each.value.auto_deploy_enabled + branch = each.value.branch + + deploy_review_apps_enabled = var.review_apps.enabled + delete_on_close_enabled = var.review_apps.delete_on_close_enabled + hours_before_delete_on_close = var.review_apps.hours_before_delete_on_close + delete_stale_enabled = var.review_apps.delete_stale_enabled + hours_before_delete_stale = var.review_apps.hours_before_delete_stale # will be available in v2.1.0 : - # automatic_creation_from_forks_allowed = each.value.automatic_creation_from_forks_allowed + # automatic_creation_from_forks_allowed = var.review_apps.automatic_creation_from_forks_allowed } diff --git a/variables.tf b/variables.tf index 42417f9..7ed3905 100644 --- a/variables.tf +++ b/variables.tf @@ -36,29 +36,48 @@ variable "authorize_unsecure_http" { nullable = false } +# router_logs and sticky_sessions are not yet supported by the provider, but will be in the future +# see https://github.com/Scalingo/terraform-provider-scalingo/issues/158 for tracking progress +# variable "router_logs" { +# description = "When true, the router logs are included in the application logs." +# type = bool +# default = false +# nullable = false +# } + +# variable "sticky_sessions" { +# description = "When true, sticky sessions are enabled." +# type = bool +# default = false +# nullable = false +# } + variable "github_integration" { + description = "Configuration of the GitHub integration of the application. Only one of github_integration or gitlab_integration can be set." type = object({ - repo_url = string - integration_uuid = optional(string) - branch = optional(string, "main") - auto_deploy_enabled = optional(bool, true) - deploy_review_apps_enabled = optional(bool, false) - delete_on_close_enabled = optional(bool, true) - delete_stale_enabled = optional(bool, true) - hours_before_delete_on_close = optional(string, "0") - hours_before_delete_stale = optional(string, "72") - automatic_creation_from_forks_allowed = optional(bool, false) + repo_url = string + integration_uuid = optional(string) + branch = optional(string, "main") + auto_deploy_enabled = optional(bool, true) }) default = null } variable "gitlab_integration" { + description = "Configuration of the GitLab integration of the application. Only one of github_integration or gitlab_integration can be set." + type = object({ + repo_url = string + integration_uuid = optional(string) + branch = optional(string, "main") + auto_deploy_enabled = optional(bool, true) + }) + default = null +} + +variable "review_apps" { + description = "Configuration of the review apps of the application." type = object({ - repo_url = string - integration_uuid = optional(string) - branch = optional(string, "main") - auto_deploy_enabled = optional(bool, true) - deploy_review_apps_enabled = optional(bool, false) + enabled = optional(bool, false) delete_on_close_enabled = optional(bool, true) delete_stale_enabled = optional(bool, true) hours_before_delete_on_close = optional(string, "0")