From b8109824a65ca7fda34d019d92a9d713e24c4c82 Mon Sep 17 00:00:00 2001 From: rpoluri <38321430+rpoluri@users.noreply.github.com> Date: Wed, 27 Oct 2021 10:16:19 -0500 Subject: [PATCH] fix to create ecs aws_iam_role_policy when deploying on ecs (#91) Co-authored-by: Raj Poluri --- CHANGELOG.md | 4 ++++ iam-ecs.tf | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2262d8c..dcd5314 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [3.3.9] - 2021-010-27 +### Fixed +- Fix to create ECS aws_iam_role_policy only when deploying on ECS. + ## [3.3.8] - 2021-010-18 ### Fixed - Fix kubernetes serviceaccount reference. diff --git a/iam-ecs.tf b/iam-ecs.tf index 74da2d3..707dfa6 100644 --- a/iam-ecs.tf +++ b/iam-ecs.tf @@ -34,7 +34,7 @@ resource "aws_iam_role_policy_attachment" "task_exec_managed" { } resource "aws_iam_role_policy" "secretsmanager_for_ecs_task_exec" { - count = var.docker_registry_auth_secret_name == "" ? 0 : 1 + count = var.wd_instance_type == "ecs" && var.docker_registry_auth_secret_name != "" ? 1 : 0 name = "secretsmanager-exec" role = aws_iam_role.waggledance_task_exec[0].id @@ -74,7 +74,7 @@ EOF } resource "aws_iam_role_policy" "secretsmanager_for_waggledance_task" { - count = var.bastion_ssh_key_secret_name == "" ? 0 : 1 + count = var.wd_instance_type == "ecs" && var.bastion_ssh_key_secret_name != "" ? 1 : 0 name = "secretsmanager" role = aws_iam_role.waggledance_task[0].id