Skip to content

Commit

Permalink
Fix template_file vars declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsan92 committed Apr 19, 2019
1 parent 97f4582 commit 243edad
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ data "template_file" "ecr-lifecycle" {

template = file("${path.module}/policies/ecr-lifecycle-policy.json")

vars {
vars = {
count = lookup(var.services[element(keys(var.services), count.index)], "registry_retention_count", var.ecr_default_retention_count)
}
}
Expand Down Expand Up @@ -114,7 +114,7 @@ data "template_file" "tasks" {

template = file("${path.cwd}/${lookup(var.services[element(keys(var.services), count.index)], "task_definition")}")

vars {
vars = {
container_name = element(keys(var.services), count.index)
container_port = lookup(var.services[element(keys(var.services), count.index)], "container_port")
repository_url = element(aws_ecr_repository.this.*.repository_url, count.index)
Expand Down Expand Up @@ -374,7 +374,7 @@ resource "aws_iam_role" "codebuild" {
data "template_file" "codebuild" {
template = file("${path.module}/policies/codebuild-role-policy.json")

vars {
vars = {
aws_s3_bucket_arn = aws_s3_bucket.this.arn
}
}
Expand All @@ -390,7 +390,7 @@ data "template_file" "buildspec" {

template = file("${path.module}/build/buildspec.yml")

vars {
vars = {
container_name = element(keys(var.services), count.index)
}
}
Expand Down Expand Up @@ -435,7 +435,7 @@ data "template_file" "codepipeline" {

template = file("${path.module}/policies/codepipeline-role-policy.json")

vars {
vars = {
aws_s3_bucket_arn = aws_s3_bucket.this.arn
ecr_repository_arn = element(aws_ecr_repository.this.*.arn, count.index)
}
Expand Down Expand Up @@ -525,7 +525,7 @@ data "template_file" "codepipeline_events" {

template = file("${path.module}/cloudwatch/codepipeline-source-event.json")

vars {
vars = {
codepipeline_names = jsonencode(aws_codepipeline.this.*.name)
}
}
Expand All @@ -535,7 +535,7 @@ data "template_file" "codepipeline_events_sns" {

template = file("${path.module}/policies/sns-cloudwatch-events-policy.json")

vars {
vars = {
sns_arn = element(aws_sns_topic.codepipeline_events.*.arn, count.index)
}
}
Expand Down Expand Up @@ -579,7 +579,7 @@ data "template_file" "metric_dashboard" {

template = file("${path.module}/metrics/basic-dashboard.json")

vars {
vars = {
region = var.region != "" ? var.region : data.aws_region.current.name
alb_arn_suffix = element(aws_lb.this.*.arn_suffix, count.index)
cluster_name = aws_ecs_cluster.this.name
Expand Down Expand Up @@ -610,7 +610,7 @@ data "template_file" "events" {

template = file("${path.module}/policies/events-role-policy.json")

vars {
vars = {
codepipeline_arn = element(aws_codepipeline.this.*.arn, count.index)
}
}
Expand All @@ -628,7 +628,7 @@ data "template_file" "ecr_event" {

template = file("${path.module}/cloudwatch/ecr-source-event.json")

vars {
vars = {
ecr_repository_name = element(aws_ecr_repository.this.*.name, count.index)
}
}
Expand Down

0 comments on commit 243edad

Please sign in to comment.