It's around three days that I'm getting crazy trying to secure via Terraform my App Engine. When I secure my application manually through GCP console my steps are:
- Create App Engine
- Activate IAP and create an OAuth consent screen
- Activate the protection to the Web Applications (=> App Engine)
Manually it works.
With terraform I have successfully created all variables, providers and activated all APIs that are needed, but my approach to secure the app seems to have something wrong, but I don't know what. Hereunder my code pieces:
- Create App Engine (it works)
resource "google_app_engine_application" "app-init" {
project = var.project_id
location_id = var.project_location
database_type = "CLOUD_FIRESTORE"
}
- Activate IAP and create an OAuth consent screen (it doesn't work)
resource "google_iap_brand" "project_brand" {
support_email = "my-owner-service-account-email@..."
application_title = "Cloud IAP protected Application"
project = "my-project-id"
}
Executing this I get this error:
Error creating Brand: googleapi: Error 409: Requested entity already exists
What's wrong with my code or my approach?
Thanks a lot in advance to every one!