Skip to content

Commit c3629f6

Browse files
authored
fix: respect create_cache_bucket variable and avoid concurrent changes to cache bucket (#296)
See #295
1 parent 7000c07 commit c3629f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/cache/main.tf

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ resource "aws_s3_bucket" "build_cache" {
6363

6464
# block public access to S3 cache bucket
6565
resource "aws_s3_bucket_public_access_block" "build_cache_policy" {
66-
bucket = local.cache_bucket_name
66+
count = var.create_cache_bucket ? 1 : 0
67+
68+
bucket = aws_s3_bucket.build_cache[0].id
6769

6870
block_public_acls = true
6971
block_public_policy = true

0 commit comments

Comments
 (0)