Last active
May 4, 2023 16:33
-
-
Save hendrixroa/94493c5d4e219045fb554723cda2715a to your computer and use it in GitHub Desktop.
AWS Clouwatch event to perform an ECS Task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_event_target" "main" { | |
target_id = "${var.app}-target" | |
arn = var.ecs_cluster | |
rule = var.event_rule | |
role_arn = var.ecs_event_role | |
ecs_target { | |
task_count = 1 | |
task_definition_arn = aws_ecs_task_definition.main.arn | |
launch_type = "FARGATE" | |
platform_version = "LATEST" | |
network_configuration { | |
security_groups = var.security_groups | |
subnets = var.subnets | |
assign_public_ip = var.public_ip | |
} | |
} | |
depends_on = [ | |
aws_ecs_task_definition.main | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment