Skip to content

Commit 0c32d21

Browse files
authored
fix: adds variable to customize ECS task security group IDs (#16)
1 parent 23a38fc commit 0c32d21

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ Before using this module, ensure you have the following:
171171
| <a name="input_cpu"></a> [cpu](#input\_cpu) | The number of CPU units to reserve for the Directus service | `number` | `2048` | no |
172172
| <a name="input_create_cloudwatch_logs_group"></a> [create\_cloudwatch\_logs\_group](#input\_create\_cloudwatch\_logs\_group) | Whether to create a CloudWatch Logs group | `bool` | `false` | no |
173173
| <a name="input_create_s3_bucket"></a> [create\_s3\_bucket](#input\_create\_s3\_bucket) | Whether to create an S3 bucket | `bool` | `false` | no |
174+
| <a name="input_ecs_security_group_ids"></a> [ecs\_security\_group\_ids](#input\_ecs\_security\_group\_ids) | The IDs of the security groups to attach to the ECS service | `list(string)` | `[]` | no |
174175
| <a name="input_ecs_service_enable_execute_command"></a> [ecs\_service\_enable\_execute\_command](#input\_ecs\_service\_enable\_execute\_command) | Whether to enable ECS service execute command | `bool` | `false` | no |
175176
| <a name="input_enable_alb_access_logs"></a> [enable\_alb\_access\_logs](#input\_enable\_alb\_access\_logs) | Whether to enable access logs of the Load Balancer | `bool` | `false` | no |
176177
| <a name="input_enable_cognito_authentication"></a> [enable\_cognito\_authentication](#input\_enable\_cognito\_authentication) | Whether to enable Cognito authentication | `bool` | `false` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ resource "aws_ecs_service" "directus" {
472472
network_configuration {
473473
assign_public_ip = false
474474
subnets = var.private_subnet_ids
475-
security_groups = [aws_security_group.ecs_sg.id]
475+
security_groups = concat([aws_security_group.ecs_sg.id], var.ecs_security_group_ids)
476476
}
477477

478478
lifecycle {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ variable "public_url" {
1010
default = ""
1111
}
1212

13+
variable "ecs_security_group_ids" {
14+
description = "The IDs of the security groups to attach to the ECS service"
15+
type = list(string)
16+
default = []
17+
}
18+
1319
variable "enable_cognito_authentication" {
1420
description = "Whether to enable Cognito authentication"
1521
type = bool

0 commit comments

Comments
 (0)