Skip to content
This repository was archived by the owner on Apr 5, 2023. It is now read-only.

Add ability to specify security groups used by ECS task #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ resource "aws_cloudwatch_event_target" "ecs_scheduled_task" {
task_count = 1
task_definition_arn = aws_ecs_task_definition.this.arn
network_configuration {
subnets = var.subnet_ids
subnets = var.subnet_ids
security_groups = var.security_group_ids
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ variable "subnet_ids" {
description = "Subnets where the job will be run"
}

variable "security_group_ids" {
type = list(string)
description = "Security groups to associate with the job"
}

variable "cloudwatch_schedule_expression" {
type = string
description = "AWS cron schedule expression"
Expand All @@ -52,4 +57,4 @@ variable "task_role_arn" {
variable "ecs_task_execution_role_name" {
default = ""
description = "If the default AWS ECSTaskExecutionRole is not sufficient for your needs, you can provide your own ECS Task Execution Role here. The module will attach a CloudWatch policy for logging purposes."
}
}