Skip to content

Enhanced documentation and property dependency for quota in google_identity_platform_config #8869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

modular-magician
Copy link
Collaborator

Fixes hashicorp/terraform-provider-google#16172

Release Note Template for Downstream PRs (will be copied)

identityplatform: marked `quota.0.sign_up_quota_config` subfields conditionally required in `google_identity_platform_config` to move errors from apply time up to plan time, and clarified the rule in documentation

Manual testing:
After the change the error message is more clear on the expectations

Sample config:

resource "google_project_service" "identitytoolkit" {
  provider = google-beta  
  project = "my-project"
  service = "identitytoolkit.googleapis.com"
}

resource "google_identity_platform_config" "default" {
  provider = google-beta  
  project = "my-project"
  autodelete_anonymous_users = true
  sign_in {
    allow_duplicate_emails = true

    email {
        enabled = false
    }

    phone_number {
      enabled = false
    }

    anonymous {
      enabled = false
    }
  }
  sms_region_config {
    allowlist_only {
      allowed_regions = [
        "US",
        "CA",
      ]
    }
  }
  quota {
    sign_up_quota_config {
      quota = 100
    }
  }
  authorized_domains = [
    "localhost",
    "pavan-test-terraform.firebaseapp.com",
    "pavan-test-terraform.web.app",
  ]

  depends_on = [ google_project_service.identitytoolkit ]
}

Error before changes:

 Error 400: INVALID_CONFIG : SignUp quota must start between now and 365 days from now.

Error after changes:

│ Error: Missing required argument
│ 
│   with google_identity_platform_config.default,
│   on main.tf line 36, in resource "google_identity_platform_config" "default":
│   36:       quota = 100
│ 
│ "quota.0.sign_up_quota_config.0.quota": all of
│ `quota.0.sign_up_quota_config.0.quota,quota.0.sign_up_quota_config.0.quota_duration,quota.0.sign_up_quota_config.0.start_time` must be specified

Derived from GoogleCloudPlatform/magic-modules#12315

…_identity_platform_config` (#12315)

[upstream:0b617ed01a5c89bc49592999607ef0141d63043b]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner December 9, 2024 17:36
@modular-magician modular-magician merged commit 03ffb7a into hashicorp:main Dec 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation for google_identity_platform_config quotas is not correct.
1 participant