Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Filter by
Sorted by
Tagged with
0 votes
0 answers
58 views

Cloud Function -> Python connect to PostgreSQL via IAM user

So im only just starting with GCP/Python. and am still in the learning phase. I'm using Terraform/Github to deploy my packages to GCP. I'm trying to get a pub/sub to trigger a Cloud Run Function to ...
0 votes
0 answers
55 views

How to use dialogflow cx agent duplication with terraform script

We are creating a Terraform script to clone a Dialogflow CX agent. However, during execution, the existing agent is being replaced instead of being cloned. Can you please confirm if it is possible to ...
2 votes
0 answers
226 views

Error creating Group: googleapi: Error 403: Error(2015): Permission denied for group resource '[email protected]'

Problem I am working on a Google Cloud Project under an Organization. I am trying to create some groups and assigning policies through Terraform. When running Terraform; the Organization Structure is ...
0 votes
0 answers
75 views

Failed to create GCP Cloud SQL instnace using Terraform

I am trying to create a Cloud SQL PostgreSQL instance using Terraform. I am using a Service Account as credentials for Google, and I have assigned the Cloud SQL Admin role to the Service Account. I am ...
0 votes
0 answers
94 views

Best Practice on inspecting Logs in Terraform Test

I am implementing end to end testing with Terraform Test for a Cloud Run solution. The desired outcomes is that a file uploaded to a storage bucket, triggers a pubsub message, which in turn triggers a ...
0 votes
0 answers
55 views

terraform .tfstate file doesn't change after removing itens

For some unknown reason, the removed items remain in the state file after I remove from the .tfstate file. CASE: downloaded my state file(my_statefile.tfstate) from cloud_bucket where it's stored In ...
0 votes
0 answers
83 views

Big query API schedule job authorisation

I have locals { creation_roles = { "cloud_scheduler_create" = "roles/cloudscheduler.admin" } running_roles = { "bigquery_job_user" = "roles/...
0 votes
0 answers
41 views

How to create map(object) template for terraform resource "google_logging_metric" to pass all the object values from .tfvars file for multiple objects

How to create map(object) template for terraform resource "google_logging_metric" to pass all the object values from .tfvars file for multiple objects? sharing sample resource for "...
1 vote
0 answers
228 views

How to attach gcloud application-default account to a gcloud configuration?

I have multiple GCP accounts for multiple clients and I handle their infrastructure using Terraform. To change between different projects/GCP accounts, I use the gcloud config configurations activate &...
1 vote
0 answers
340 views

How do I actually use the files generated from Terraformer

I don't have much experience with Terraform or cloud infrastructure in general, but I need to clone an existing production GCP project so I can at least get a basic staging backend set up. I figured ...
0 votes
0 answers
241 views

Unexpected terraform "forces replacement" for google_artifact_registry_repository resource

I'm trying to add upstream_credentials to a remote repository using google_artifact_registry_repository terraform module. I can do this via UI with no problem, however, when attempted via terraform, I ...
1 vote
0 answers
156 views

how to write an output in terraform module to get the bigquery table ids as part of data source?

I am trying to get list of tables in a bigquery dataset using terraform data source inside a module. I have written below code but it returns the entire path to the tables. I only need the table id. ...
1 vote
0 answers
285 views

GCP google_sql_user password not being set properly

I have the below Terraform file I am using to deploy to GPC using my Github Actions pipeline. I am using the google_sql_user terraform registry. I see that my database is being deployed, however; I ...
0 votes
0 answers
474 views

How to Grant SYSTEM_USER Privilege Using Terraform for MySQL Database?

I'm trying to automate the setup of a MySQL database using Terraform for my project hosted on Google Cloud Platform (GCP). However, I'm encountering an issue when attempting to execute a SQL script ...
0 votes
0 answers
182 views

How to create specific version GKE cluster master and nodepool using Terraform

I am trying to crate GKE cluster with specific version but it's not working. Please can some one help which option/flag need to use to create specific version. I have tried the following option under ...
0 votes
0 answers
192 views

How can I automate retrieving the GCP application default credentials from the terraform vault?

I am trying to supply the GCP application credentials to terraform via the HashiCorp vault. I have managed to do it by first executing gcloud auth application-default login, but I would like to ...
0 votes
0 answers
720 views

Terraform not detecting the right project when modifying Org Policy

Using Terraform in my local terminal, I've been trying to disable the Disable Service Account Key Creation policy for a specific project and stop it from inheriting the policy from the parent ...
1 vote
0 answers
412 views

Can we Enable notifications preferences on CloudSQL by terraform?

enter image description here i can see there is only option to enable from google cloud console. is it possible to set the notifications by terraform modules for cloud sql in GCP? if possible could ...
1 vote
0 answers
299 views

Terrafrom tries to drop cert before updating https proxy

I'm trying to destroy infra I currently have with terraform. I have multiple certificates specified and one https proxy. resource "google_compute_managed_ssl_certificate" "app_cert"...
0 votes
0 answers
87 views

GCP Terraform CICD pipeline getting failed in GitHub

`Hi folks, I am facing issue in my cicd pipline on GCP cloud which i set in github with terraform workflow. bellow error I am getting. Run terraform plan -input=false /home/runner/work/_temp/86fbf72d-...
1 vote
0 answers
1k views

Creating google_project_iam_binding deletes google_project_iam_member

I'm creating a Cloud Run service to act upon PubSub trigger using Terraform. I've added the relevant terraform code, and besides that I also have the following portion already defined: # bind token ...
1 vote
0 answers
97 views

Trouble with Terraform Provisioner File: Copying File to GCP VM

I'm setting up a VM in Google Cloud Platform (GCP) via Terraform and transferring a service account to it using a file. I've utilized the the provisioner file to copy the file from source to ...
0 votes
0 answers
143 views

Provision a GCP regional instance group via Terraform

I am exploring managed instance groups on GCP, and I am trying to create a multi-zone (regional) MIG. The instance template gets created however, it always fails to create the MIG declaring a ...
1 vote
0 answers
352 views

(Terraform) BigQuery Job misses IAM permissions, which have been granted

I read this blogpost about the recently published Document AI - BigQuery Integration. I want to configure this setup completly using terraform. An important step in the blog post is the configuration ...
3 votes
0 answers
345 views

How can I configure `Authorised Domains` when deploying oidc provider to gcp via terraform?

I am deploying OIDC provider to GCP via terraform. I am using this doc as instruction to set it up: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/...
1 vote
0 answers
138 views

Terraform: configure Google provider with not-yet-existent service account (impersonation)

We are using Terraform 1.6.3 with google v5.11.0 provider. We would like to automate everything right from the beginning - project creation, service account serviceacc creation and Google provider ...
0 votes
0 answers
116 views

Trouble Assigning Public IP to GCP Compute Instance with CDKTF in Python

I am currently exploring CDKTF (Terraform's Cloud Development Kit) with Python to manage GCP resources, specifically to create a GCP compute instance with a public IP address. While I've successfully ...
0 votes
0 answers
233 views

Terraform: use not-yet-existent service account credentials to configure Google provider

We are using Terraform 1.6.3 with google v5.8.0 provider. We would like to automate project creation, service account & key creation and compute engine deployment. We would like to authenticate ...
0 votes
0 answers
460 views

Cloud Function with Pub/sub trigger always creates new Eventarc subscription for the Topic

I'm currently working on a project where I'm using Google Cloud Functions triggered by Pub/Sub messages. In my workflow, When I create a Cloud Function with pubsub trigger, it automatically create a ...
0 votes
0 answers
313 views

Terraform cloud issue fetching google artifact registry versions

I wrote a script to pull the latest image version from google artifact registry so that my terraform cloud deployments will always deploy the latest version of my GCP image. exec 2>/dev/null ...
0 votes
0 answers
382 views

Unable to create a Google Cloud alerting policy with Terraform

In Google Cloud Monitoring, I want to create alerting policies for a MongoDB database hosted on a Compute Engine instance. While it gets created successfully via GC console, it fails to get created ...
0 votes
0 answers
176 views

Terraform adding network endpoints on a Hybrid NEG problem

Initially I used to add an network endpoint resource "google_compute_network_endpoint" "endpoint1" { network_endpoint_group = google_compute_network_endpoint_group.neggroup.name ...
0 votes
0 answers
192 views

Why is my Terraform ConfigMap Trying Localhost Instead of GCP?

My ConfigMap is obsessed with connecting to my localhost and I want it to connect to Google Cloud. Question: How do I get my Config Map to connect to GCP? Below is the error I am getting from ...
1 vote
0 answers
453 views

Error code 13 while deploying google cloud function (terraform) from dev to qa

I am facing an issue while deploying google cloud functions using terraform from dev to qa. Here is an error code that I got in gitlab. Error: Error waiting for Creating Cloud Functions Function: ...
0 votes
0 answers
173 views

Delete specific resource from a module via Terraform

Terraform Gurus, I am trying to delete one VM from a bunch of VMs. Right now, I have two VMs but that number could vary. I am looking for the ability to delete a specific VM. I am familiar with ...
0 votes
0 answers
295 views

Terraform Error object has no exported attribute named "url" in google_cloudfunctions2_function, while using in google_pubsub_subscription

I'm trying to set up a Google Cloud Functions Gen2 using Terraform and then use the URL attribute of the google_cloudfunctions2_function resource in a google_pubsub_subscription resource. But not able ...
0 votes
0 answers
645 views

GKE resources recreated on every `terraform apply` without any configuration changes

I'm encountering a behavior with the Google Cloud Terraform provider where GKE resources are being recreated every time I run terraform apply, even though there are no configuration changes. I've ...
0 votes
0 answers
182 views

Having issues with applying GCP terraform network code

I'm getting this error when I do a terraform apply but not a plan. I'm not sure what I am missing. I have ran a terraform validate and it was clean. From searching all the information I found online ...
0 votes
0 answers
31 views

Terraform: Map of many types and accessing values

I'm trying to figure out how to document and build some HA-VPN's in GCP using terraform, and I don't know the number of HA-VPN's that will be required. I have a module that builds them which I need to ...
1 vote
0 answers
242 views

Why after recreating vm in gcp via terraform some roles are dropping?

I use some resource to give role to the host, such as google_compute_instance_iam_member google_compute_instance_iam_binding When i change hostname of host in terraform, host go to recreating (which ...
0 votes
0 answers
59 views

change the array principal to get role based instead of Service account based

I need to change a code to work with IAM conditions: Today our code has a variable that has multiple principals and each principal has one or more roles in the format as describe in the inline code ...
0 votes
0 answers
152 views

Terraform google_compute_firewall not accepting project variable

I am trying to deploy one firewall rule in multiple projects I declare in variable file. I have created terraform module for this. Below is my parent module's main.tf file. module "...
1 vote
0 answers
791 views

Is there a way to ignore environment variable changes using google_cloud_run_service in Terraform?

I am using the google_cloud_run_service Terraform resource to create Google Cloud Run services. Currently, whenever Environment Variables of a Cloud Run service are updated, Terraform sees this as a ...
0 votes
0 answers
425 views

Add terraform log message after resource creation

I have built custom terraform provider, now for the finishing touch I would like to add some message in "STRING" format after resource has done creating. The problem i am facing is I am ...
3 votes
0 answers
946 views

terraform plan throws unwanted "update in place" even though resource has not changed at all

I have the following CLoudSQL resource in a module: resource "google_sql_database_instance" "myCloudSql" { name = "my-sql-name-${var.environment}" region ...
1 vote
0 answers
218 views

GitHub Actions, Terraform, and GCP: Github Runner permissions and service account integration issues

I working on automating CI/CD pipeline using GitHub Actions. I have already set up Terraform that deploys the infrastructure on GCP. GitHub Actions is authenticated to Google Cloud via the following ...
0 votes
0 answers
706 views

How to ignore specific metadata using ignore_changes block?

The thing is I know Terraform ignore_changes block only supports static lists or in another words, static indices mapping to items. Secondly, I need to be able to ignore specific metadata based on a ...
1 vote
0 answers
693 views

Connecting gcp cloud run instance to filestore with terraform

I'm trying to recreate the tutorial howto connect filestore to gcp cloud run with terraform. My terraform is now, terraform { required_version = ">= 1.0.0" required_providers { ...
3 votes
0 answers
692 views

GCP Organization Policy Exception Condition for One Service Account

In our GCP Organization, we have a "push" method on service account keys. Currently, there we have an organization policy, constraints/iam.disableServiceAccountKeyCreation , I would like to ...
0 votes
0 answers
168 views

Unable to add multiple scaling schedules in GCP VM using terraform

Below is the terraform code: resource "google_compute_autoscaler" "default" { provider = google-beta name = "my-autoscaler" zone = "us-central1-f" ...