Skip to content

Commit

Permalink
Avoid default route collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
mogul committed Dec 9, 2024
1 parent a813ebe commit c059f97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions spiffworkflow/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
locals {
route_prefix = (var.route_prefix != "" ? var.route_prefix : random_pet.route_prefix.id)

backend_route = "${local.frontend_route}/api"
connector_route = "${var.route_prefix}-connector.apps.internal"
frontend_route = "${var.route_prefix}.app.cloud.gov"
connector_route = "${local.route_prefix}-connector.apps.internal"
frontend_route = "${local.route_prefix}.app.cloud.gov"

username = random_uuid.username.result
password = random_password.password.result
Expand Down Expand Up @@ -51,6 +53,10 @@ resource "random_password" "password" {
special = false
}

resource "random_pet" "route_prefix" {
prefix = "spiffworkflow"
}

resource "random_password" "backend_flask_secret_key" {
length = 32
special = true
Expand Down
4 changes: 2 additions & 2 deletions spiffworkflow/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ variable "app_prefix" {

variable "route_prefix" {
type = string
description = "prefix to use for the application routes (<route_prefix>-connector.app.internal, <route_prefix>.apps.fr.cloud.gov[/api])"
default = "spiffworkflow"
description = "prefix to use for the application routes (<route_prefix>-connector.app.internal, <route_prefix>.apps.fr.cloud.gov[/api]); leave empty to generate"
default = ""
}

variable "rds_plan_name" {
Expand Down

0 comments on commit c059f97

Please sign in to comment.