Skip to content
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

Enhanced documentation and property dependency for quota in google_identity_platform_config #12315

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pashanka
Copy link
Contributor

Fixes hashicorp/terraform-provider-google#16172

Release Note Template for Downstream PRs (will be copied)

identityplatform: Enhanced documentation and property dependency for `quota` in `google_identity_platform_config`

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

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 15 insertions(+), 12 deletions(-))
google-beta provider: Diff ( 2 files changed, 15 insertions(+), 12 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 17
Passed tests: 15
Skipped tests: 2
Affected tests: 0

Click here to see the affected service packages
  • identityplatform

🟢 All tests passed!

View the build log

@pashanka pashanka marked this pull request as ready for review November 13, 2024 07:10
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@rainshen49
Copy link
Contributor

rainshen49 commented Nov 13, 2024

Add quota_start_time: '2014-10-02T15:01:23Z' to test_env_vars in https://github.com/rainshen49/magic-modules/blob/main/mmv1/products/identityplatform/Config.yaml#L52-L54. This is the value that gets shown in the documentation. Currently, the documentation shows an empty start_time, which is confusing.

   sign_up_quota_config {
      quota = 1000
      start_time = ""
      quota_duration = "7200s"
    }

Note that tests will use the override value below:
'quota_start_time': 'time.Now().AddDate(0, 0, 1).Format(time.RFC3339)', so the above change is for presentation purposes only.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 16 insertions(+), 13 deletions(-))
google-beta provider: Diff ( 2 files changed, 16 insertions(+), 13 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 17
Passed tests: 15
Skipped tests: 2
Affected tests: 0

Click here to see the affected service packages
  • identityplatform

🟢 All tests passed!

View the build log

Copy link
Contributor

@rainshen49 rainshen49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation for google_identity_platform_config quotas is not correct.
3 participants