terraform-aws-gitlab-runner
terraform-aws-gitlab-runner copied to clipboard
cache: environment is not included as bucket name prefix
The docs describe the environment
variable as:
A name that identifies the environment, used as prefix and for tagging.
However, environment
appears to only be used for tags and is not included in the prefix (see https://github.com/npalm/terraform-aws-gitlab-runner/blob/5.0.2/modules/cache/main.tf#L15.). Am I right in thinking the intent was to include this in the prefix?
Seems that there is a cache_bucket_prefix
which is used for the caches. So I think this is correct.
By the way: I have multiple Agents running but deployed the cache module only once. Is there a benefit having multiple cache buckets?
Any news here @ashanbrown ?
If the environment is not included in the prefix, then the s3 buckets will collide if a shared bucket is not used. I was thinking that if the user chooses not to use a shared bucket but to have multiple environments, it should "just work."
I agree that a shared bucket is probably a good practice but for lifecycle reasons, it might be useful to spin up and tear down environments independently.
Good point. The documentation of environment
says A name that identifies the environment, used as prefix and for tagging.
Well, in this case it wasn't used as prefix. So the code is wrong.
By the way: We introduced a resource_prefix
variable in our own Terraform code. Just to make clear that every resource has to be prefixed with this value.