-
Notifications
You must be signed in to change notification settings - Fork 720
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
Bucket name length exceeds 63 characters with non-US region deployment #1166
Comments
Also verify upcoming change in |
ACK that some regions with long names tend to exceed the character limit for resource names (this problem can happen in many places, not just the bucket in this issue). For the v5 changes, we'll evaluate if there's a better way to address this consistently, such as logic to truncate excessively long resource names, or a convention to abbreviate region names to a consistent length instead of writing out the full name. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
TL;DR
When deploying 1-org
Error: error: bucket name validation failed bkt-cai-monitoring-5003-sources-699933893618-northamerica-northeast2
with module.cai_monitoring.module.cloudfunction_source_bucket.google_storage_bucket.bucket,
on ../../../terraform-google-modules/cloud-storage/google/modules/simple_bucket/main.tf line 17, in resource "google_storage_bucket" "bucket":
17: resource "google_storage_bucket" "bucket" {
Expected behavior
Limit name to max 63 characters regardless of how long the region name is
Observed behavior
No response
Terraform Configuration
Terraform Version
Additional information
Very easy (and tested) fix also guaranteeing uniqueness
in 1-org/modules/cai-monitoring/main.tf
locals {
project_service_apis = [
... etc ...
]
cai_source_name = var.random_suffix ? "CAI Monitoring - ${random_id.suffix.hex}" : "CAI Monitoring"
add this:
cai_monitoring_bucket_suffix = "${random_id.suffix.hex}-sources-${data.google_project.project.number}-${var.location}"
...
module "cloudfunction_source_bucket" {
...
// deterministic name length < 63 chars
// name = "bkt-cai-monitoring-${random_id.suffix.hex}-sources-${data.google_project.project.number}-${var.location}"
name = "bkt-cai-monitoring-${md5(local.cai_monitoring_bucket_suffix)}"
The text was updated successfully, but these errors were encountered: