hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

Error creating Brand #20204

Open dominique-lambert-OBS opened 3 weeks ago

dominique-lambert-OBS commented 3 weeks ago

Community Note

Terraform Version & Provider Version(s)

Terraform v1.7.2 on Google cloud

Affected Resource(s)

google_iap_brand

Terraform Configuration

resource "google_iap_brand" "project_brand" {
  support_email     = "my_address@myorg.com"
  application_title = "Cloud IAP protected Application"
  project  = var.project_id
}
provider "google" {
  impersonate_service_account = var.sa-stack
}
sa-stack = "sa-stack@xxxxx.iam.gserviceaccount.com"
project_id      = "prj-xxxx"

Debug Output

Terraform will perform the following actions:

google_iap_brand.project_brand will be created

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.

Enter a value: yes google_iap_brand.project_brand: Creating... ╷ │ Error: Error creating Brand: googleapi: Error 400: Request contains an invalid argument. │ │ with google_iap_brand.project_brand, │ on iap_web_app.tf line 1, in resource "google_iap_brand" "project_brand": │ 1: resource "google_iap_brand" "project_brand" { │ ╵

Expected Behavior

No response

Actual Behavior

the brand is note created

Steps to reproduce

  1. terraform apply

Important Factoids

References

No response

ggtisc commented 6 days ago

Hi @dominique-lambert-OBS

I tried to replicate this issue with the following code but everything was good without errors. I suggest you check your variables, read the terraform registry and API documentation to confirm each argument has a valid value and try it again. Also you can read how to Setting up IAP brand

resource "google_iap_brand" "iap_20204" {
  support_email     = "support@my-org.domain.net"
  application_title = "iap-20204"
  project           = "my-main-project-name"
}
resource "google_project" "project_20204" {
  name = "sub-project-20204"
  project_id = "sub-project-20204"
  org_id = "1234567890" #GOOGLE_ORG/ORG_ID
  billing_account = "012345A-67890B-098765C"
}

resource "google_iap_brand" "iap_20204" {
  support_email     = "support@my-org.domain.net"
  application_title = "iap-20204"
  project           = google_project.project_20204.name
}