Skip to content

Commit

Permalink
fix: Add var.environment to the name of the S3 cache bucket #533 (#555)
Browse files Browse the repository at this point in the history
* add `var.environment` to name of cache bucket

* shorten the hostname if no override is used

Co-authored-by: kayma <[email protected]>
  • Loading branch information
npalm and kayman-mk authored Oct 13, 2022
1 parent cf594ca commit 6e0cd97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/cache/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ locals {
var.tags,
)

cache_bucket_string = var.cache_bucket_name_include_account_id ? format("%s%s-gitlab-runner-cache", var.cache_bucket_prefix, data.aws_caller_identity.current.account_id) : format("%s-gitlab-runner-cache", var.cache_bucket_prefix)
cache_bucket_string = var.cache_bucket_name_include_account_id ? format("%s-%s%s-gitlab-runner-cache", var.environment, var.cache_bucket_prefix, data.aws_caller_identity.current.account_id) : format("%s-%s-gitlab-runner-cache", var.environment, var.cache_bucket_prefix)
cache_bucket_name = var.cache_bucket_set_random_suffix ? format("%s-%s", local.cache_bucket_string, random_string.s3_suffix[0].result) : local.cache_bucket_string

name_iam_objects = var.name_iam_objects == "" ? local.tags["Name"] : var.name_iam_objects
Expand Down

0 comments on commit 6e0cd97

Please sign in to comment.