Skip to content

Commit

Permalink
Merge pull request #4 from WarnerMedia/templatefix
Browse files Browse the repository at this point in the history
removed unsupported template resource
  • Loading branch information
awlawl authored Oct 31, 2023
2 parents fdfbfa1 + e4b675e commit 9bf091b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ecs-event-stream.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ resource "aws_cloudwatch_event_target" "ecs_event_stream" {
arn = aws_lambda_function.ecs_event_stream[0].arn
}

data "template_file" "lambda_source" {
template = <<EOF
locals {
lambda_code = <<EOF
exports.handler = (event, context, callback) => {
console.log(JSON.stringify(event));
}
EOF

}

data "archive_file" "lambda_zip" {
count = var.create_ecs_dashboard ? 1 : 0
type = "zip"
source_content = data.template_file.lambda_source.rendered
source_content = local.lambda_code
source_content_filename = "index.js"
output_path = "ecs-events-lambda-${var.app}.zip"
}
Expand Down

0 comments on commit 9bf091b

Please sign in to comment.