'Terraform code for GCP private cluster not working

I have the terraform code for GCP private cluster and it was working one month back, but today I am trying it and it's giving error now.

Error: googleapi: Error 400: Alias IP addresses are required for private cluster, please make sure you enable alias IPs when creating a cluster., badRequest

  on modules/gke-cluster/main.tf line 20, in resource "google_container_cluster" "cluster":
  20: resource "google_container_cluster" "cluster" {

Am I missing somthing. Help will be appreciated



Solution 1:[1]

To enable IP aliasing, you need to use the ip_allocation_policy property

The block can be left empty as all arguments inside are optional.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sylvain B