Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add field create_aws_s3_bucket_public_access_block to variable runner_worker_cache #1105

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ module "cache" {
kms_key_id = local.kms_key

name_iam_objects = local.name_iam_objects

create_aws_s3_bucket_public_access_block = var.runner_worker_cache.create_aws_s3_bucket_public_access_block
}

################################################################################
Expand Down
2 changes: 2 additions & 0 deletions modules/cache/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "build_cache_encry

# block public access to S3 cache bucket
resource "aws_s3_bucket_public_access_block" "build_cache_policy" {
count = var.create_aws_s3_bucket_public_access_block ? 1 : 0

bucket = aws_s3_bucket.build_cache.id

block_public_acls = true
Expand Down
4 changes: 4 additions & 0 deletions modules/cache/moved.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
moved {
KevinSnyderCodes marked this conversation as resolved.
Show resolved Hide resolved
from = aws_s3_bucket_public_access_block.build_cache_policy
to = aws_s3_bucket_public_access_block.build_cache_policy[0]
}
5 changes: 5 additions & 0 deletions modules/cache/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,8 @@ variable "kms_key_id" {
type = string
default = ""
}

variable "create_aws_s3_bucket_public_access_block" {
KevinSnyderCodes marked this conversation as resolved.
Show resolved Hide resolved
type = bool
default = true
}
30 changes: 18 additions & 12 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,19 @@ variable "runner_worker_cache" {
versioning = Boolean used to enable versioning on the cache bucket. Requires `create = true`.
EOT
type = object({
access_log_bucket_id = optional(string, null)
access_log_bucket_prefix = optional(string, null)
authentication_type = optional(string, "iam")
bucket = optional(string, "")
bucket_prefix = optional(string, "")
create = optional(bool, true)
expiration_days = optional(number, 1)
include_account_id = optional(bool, true)
policy = optional(string, "")
random_suffix = optional(bool, false)
shared = optional(bool, false)
versioning = optional(bool, false)
access_log_bucket_id = optional(string, null)
access_log_bucket_prefix = optional(string, null)
authentication_type = optional(string, "iam")
bucket = optional(string, "")
bucket_prefix = optional(string, "")
create = optional(bool, true)
expiration_days = optional(number, 1)
include_account_id = optional(bool, true)
policy = optional(string, "")
random_suffix = optional(bool, false)
shared = optional(bool, false)
versioning = optional(bool, false)
create_aws_s3_bucket_public_access_block = optional(bool, true)
KevinSnyderCodes marked this conversation as resolved.
Show resolved Hide resolved
KevinSnyderCodes marked this conversation as resolved.
Show resolved Hide resolved
})
default = {}
}
Expand Down Expand Up @@ -765,3 +766,8 @@ variable "debug" {
})
default = {}
}

variable "create_aws_s3_bucket_public_access_block" {
KevinSnyderCodes marked this conversation as resolved.
Show resolved Hide resolved
type = bool
default = true
}
Loading