Skip to content

Commit f69c8bb

Browse files
authored
fix: do not add the cache access policy if there is none (#540)
* do not add a policy if we have none * consider manual ARN
1 parent 4ed5d7b commit f69c8bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ resource "aws_iam_role_policy_attachment" "user_defined_policies" {
390390
### Policy for the docker machine instance to access cache
391391
################################################################################
392392
resource "aws_iam_role_policy_attachment" "docker_machine_cache_instance" {
393+
count = var.cache_bucket["create"] || length(lookup(var.cache_bucket, "policy", "")) > 0 ? 1 : 0
394+
393395
role = aws_iam_role.instance.name
394396
policy_arn = local.bucket_policy
395397
}

0 commit comments

Comments
 (0)