Skip to content

Commit

Permalink
Merge pull request #6 from schubergphilis/fix_no_subnets
Browse files Browse the repository at this point in the history
bug: Add subnet configuration only if subnets are specified
  • Loading branch information
Plork authored Oct 1, 2024
2 parents 9df4560 + d3957dc commit c15e472
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,14 @@ resource "aws_cloudwatch_event_target" "default" {
task_definition_arn = aws_ecs_task_definition.default.arn
platform_version = "1.4.0"

network_configuration {
assign_public_ip = false
security_groups = [aws_security_group.default[0].id]
subnets = var.subnet_ids
dynamic "network_configuration" {
for_each = var.subnet_ids != null ? { create : true } : {}

content {
assign_public_ip = false
security_groups = [aws_security_group.default[0].id]
subnets = var.subnet_ids
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ variable "bucket_prefix" {
type = string
default = "/"
description = "The prefix to use for the bucket"
nullable = false

validation {
condition = can(regex("^\\/", var.bucket_prefix))
Expand Down

0 comments on commit c15e472

Please sign in to comment.