GoogleCloudPlatform / cloud-foundation-fabric

End-to-end modular samples and landing zones toolkit for Terraform on GCP.
Apache License 2.0
1.56k stars 893 forks source link

[alloydb] cannot set the initial user in the secondary cluster #2664

Closed baran81 closed 1 week ago

baran81 commented 3 weeks ago

Describe the bug Alloydb module try to create the secondary cluster passing the initial_user argument. the api fail with:

 Error: Error creating Cluster: googleapi: Error 400: The request was invalid: cannot set the initial user in the secondary cluster
 Details:
 [
   {
     "@type": "type.googleapis.com/google.rpc.BadRequest",
     "fieldViolations": [
       {
         "field": "initial_user"
       }
     ]
   },
   {
     "@type": "type.googleapis.com/google.rpc.RequestInfo",
     "requestId": "7f2f00895fffca09"
   }
 ]

   with module.alloydb["aiod1"].google_alloydb_cluster.secondary[0],
   on .terraform/modules/alloydb/main.tf line 226, in resource "google_alloydb_cluster" "secondary":
  226: resource "google_alloydb_cluster" "secondary" {

Environment

Terraform v1.9.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v6.6.0
+ provider registry.terraform.io/hashicorp/google-beta v6.6.0
+ provider registry.terraform.io/hashicorp/random v3.6.3

Your version of Terraform is out of date! The latest version
is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html

To Reproduce

create a cluster with secondary and set the initial user with name and password

Result

 Error: Error creating Cluster: googleapi: Error 400: The request was invalid: cannot set the initial user in the secondary cluster
 Details:
 [
   {
     "@type": "type.googleapis.com/google.rpc.BadRequest",
     "fieldViolations": [
       {
         "field": "initial_user"
       }
     ]
   },
   {
     "@type": "type.googleapis.com/google.rpc.RequestInfo",
     "requestId": "7f2f00895fffca09"
   }
 ]

   with module.alloydb["aiod1"].google_alloydb_cluster.secondary[0],
   on .terraform/modules/alloydb/main.tf line 226, in resource "google_alloydb_cluster" "secondary":
  226: resource "google_alloydb_cluster" "secondary" {
ludoo commented 1 week ago

Closing this as relevant PR has been merged. Thanks Simo :)