Error while creating AlloyDB cluster using PITR for postgres user

I am currently working on creating a new AlloyDB cluster and primary instance using the Point-In-Time Recovery (PITR) option via Terraform. However, I am encountering an error when running terraform apply . Below are the details:

Error Message:

module.gcp_alloydb2.google_alloydb_instance.primary_instance: Creating...

Error: Error creating Instance: googleapi: Error 400: The request was invalid: password can not contain username as a substring

Details:
[
 {
  "@type": "type.googleapis.com/google.rpc.BadRequest",
  "fieldViolations": [
   {
    "field": "cluster.initial_user.password"
   }
  ]
 },
 {
  "@type": "type.googleapis.com/google.rpc.RequestInfo",
  "requestId": "73c509ada3fbbccc"
 }
]

with module.gcp_alloydb2.google_alloydb_instance.primary_instance,
on ......main.tf line 263, in resource "google_alloydb_instance" "primary_instance":
263: resource "google_alloydb_instance" "primary_instance" {

Context:

We use a module to provision an AlloyDB cluster, and inside the primary instance, we have the following configuration:

initial_user {
  user     = "postgres"
  password = random_password.root_password.result
}

Random Password Resource:

# Random temporary password 
resource "random_password" "root_password" {
  length            = 16
  special           = true
  override_special  = "_%@"
}

PITR Block Code:

resource "google_alloydb_cluster" "restored_via_pitr" {
  count       = var.restore_pitr == true ? 1 : 0
  depends_on  = [google_project_service.my_enabled_api]
  cluster_id  = var.cluster_id-newcluster
  location    = var.location
  network_config {
    network = data.google_compute_network.vpc.id
  }

  initial_user {
    user     = "postgres"
    password = random_password.root_password.result
  }

  restore_continuous_backup_source {
    cluster       = var.cluster-src
    point_in_time = var.point_in_time
  }
}

Additional Information:

  • This error started occurring after we enabled Public IP on the instance and set the following flag, which is required for Public IP enablement:
"password.enforce_password_does_not_contain_username" = "on"

Versions:

  • Using previously-installed hashicorp/google v5.38.0
  • Using previously-installed hashicorp/random v3.6.2

Request for Assistance:

I am currently working on creating a new AlloyDB cluster and primary instance using the Point-In-Time Recovery (PITR) option via Terraform. However, I am encountering an error when running terraform apply . Below are the details:

Error Message:

module.gcp_alloydb2.google_alloydb_instance.primary_instance: Creating...

Error: Error creating Instance: googleapi: Error 400: The request was invalid: password can not contain username as a substring

Details:
[
 {
  "@type": "type.googleapis.com/google.rpc.BadRequest",
  "fieldViolations": [
   {
    "field": "cluster.initial_user.password"
   }
  ]
 },
 {
  "@type": "type.googleapis.com/google.rpc.RequestInfo",
  "requestId": "73c509ada3fbbccc"
 }
]

with module.gcp_alloydb2.google_alloydb_instance.primary_instance,
on ......main.tf line 263, in resource "google_alloydb_instance" "primary_instance":
263: resource "google_alloydb_instance" "primary_instance" {

Context:

We use a module to provision an AlloyDB cluster, and inside the primary instance, we have the following configuration:

initial_user {
  user     = "postgres"
  password = random_password.root_password.result
}

Random Password Resource:

# Random temporary password 
resource "random_password" "root_password" {
  length            = 16
  special           = true
  override_special  = "_%@"
}

PITR Block Code:

resource "google_alloydb_cluster" "restored_via_pitr" {
  count       = var.restore_pitr == true ? 1 : 0
  depends_on  = [google_project_service.my_enabled_api]
  cluster_id  = var.cluster_id-newcluster
  location    = var.location
  network_config {
    network = data.google_compute_network.vpc.id
  }

  initial_user {
    user     = "postgres"
    password = random_password.root_password.result
  }

  restore_continuous_backup_source {
    cluster       = var.cluster-src
    point_in_time = var.point_in_time
  }
}

Additional Information:

  • This error started occurring after we enabled Public IP on the instance and set the following flag, which is required for Public IP enablement:
"password.enforce_password_does_not_contain_username" = "on"

Versions:

  • Using previously-installed hashicorp/google v5.38.0
  • Using previously-installed hashicorp/random v3.6.2

Request for Assistance:

  1. Can anyone confirm if the primary instance should inherit users and service accounts from the source primary instance when using the PITR feature?
  2. Has anyone encountered a similar issue with the password.enforce_password_does_not_contain_username flag in Terraform? Any guidance on how to resolve this would be greatly appreciated.

Has anyone encountered a similar issue with the password.enforce_password_does_not_contain_username flag in Terraform? Any guidance on how to resolve this would be greatly appreciated.

Thank you in advance for your assistance!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật