Skip to content

Conversation

@OscarVanL
Copy link
Contributor

Fixes #733

My database name is 35 characters long. The Managed by Terraform - Service account for backup of SQL Instance string is 66 characters long. In total this makes 101 characters, which fails the validation check to create the service account:

Error: Error creating service account: googleapi: Error 400: The display_name length (101) is longer than the maximum allowed length 100., badRequest
  with module.cloudsql_backup[0].google_service_account.sql_backup_serviceaccount[0],
  on .terraform/modules/cloudsql_backup/modules/backup/main.tf line 33, in resource "google_service_account" "sql_backup_serviceaccount":
  33: resource "google_service_account" "sql_backup_serviceaccount" {

This change will truncate the display_name if it exceeds 100 characters.

…ount can be created successfully if the SQL instance name is long
@OscarVanL OscarVanL requested review from a team, ayushmjain, imrannayer and q2w as code owners May 21, 2025 13:22
@imrannayer
Copy link
Collaborator

/gcbrun

@OscarVanL
Copy link
Contributor Author

OscarVanL commented May 21, 2025

@imrannayer Thanks for running the tests. What are your thoughts on this, is it ok?

@imrannayer imrannayer merged commit edc7ee7 into terraform-google-modules:main May 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backups module generates service account with display name that is too long (>100 chars)

2 participants