Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tofu/config/development/infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions tofu/config/development/infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ module "app" {
)

# If we're using one of our shared domain, put the application under a
# subdomain of its own.
subdomain = try(each.value.domain, null) != null ? null : each.key
# subdomain of its own unless the subdomain is explicitly set.
subdomain = try(
each.value.subdomain,
try(each.value.domain, null) != null ? null : each.key
)

logging_bucket = module.logging.bucket
logging_key_arn = module.logging.kms_key_arn
vpc_id = module.vpc.vpc_id
private_subnets = module.vpc.private_subnets
Expand Down
2 changes: 1 addition & 1 deletion tofu/modules/app/local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ locals {
for lambda in data.aws_lambda_functions.all.function_names :
lambda if length(regexall("^DatadogIntegration-ForwarderStack-", lambda)) > 0
]
domain_prefix = "${var.subdomain == null ? "" : ".${var.subdomain}"}${local.production ? "" : ".${var.environment}"}"
domain_prefix = var.subdomain == null ? "" : var.subdomain
log_groups = setunion(
data.aws_cloudwatch_log_groups.ecs.log_group_names,
data.aws_cloudwatch_log_groups.ecs_insights.log_group_names,
Expand Down
11 changes: 8 additions & 3 deletions tofu/modules/app/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "secrets" {
source = "github.com/codeforamerica/tofu-modules-aws-secrets?ref=1.0.0"
source = "github.com/codeforamerica/tofu-modules-aws-secrets?ref=secret-name"

project = var.project
environment = var.environment
Expand Down Expand Up @@ -33,9 +33,14 @@ module "service" {
service_short = try(each.value.short_name, each.key)
desired_containers = try(each.value.desired_containers, local.production ? 2 : 1)
health_check_path = try(each.value.health_check_path, "/health")
logging_bucket = var.logging_bucket

domain = var.domain
subdomain = "${try(each.value.subdomain, "www")}${local.domain_prefix}"
domain = var.domain
subdomain = join(".", compact([try(each.value.subdomain, null), local.domain_prefix]))
create_repository = try(each.value.image, null) == null
image_url = try(each.value.image, "")
repository_arn = try(each.value.repository_arn, null)
image_tag = try(each.value.image_tag, "latest")
force_delete = !local.production
oidc_settings = local.oidc_settings

Expand Down
5 changes: 5 additions & 0 deletions tofu/modules/app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ variable "internal" {
default = true
}

variable "logging_bucket" {
description = "The S3 bucket used for logging."
type = string
}

variable "logging_key_arn" {
description = "The ARN of the KMS key used for logging."
type = string
Expand Down