Skip to content

Conversation

@jonathanfuller-pingidentity
Copy link
Contributor

Change Description

CDI-660: Add pingone_rate_limit_configuration resource

Change Characteristics

  • This PR contains beta functionality
  • This PR requires introduction of breaking changes
  • No changelog entry is needed

Checklist

All full (or complete) PRs that need review prior to merge should have the following box checked.

If contributing a partial or incomplete change (expecting the development team to complete the remaining work) please leave the box unchecked

  • Check to confirm: I have performed a review of my PR against the PR checklist and confirm that:
    • The changelog entry has been included according to the changelog process
    • Changes have proper test coverage (including regression tests)
    • Impacted resource, data source and schema descriptions have been reviewed and updated
    • Impacted resource and data source documentation HCL examples have been reviewed and updated
    • Does not introduce breaking changes (unless required to do so)
    • I am aware that changes to generated code may not be merged

Required SDK Upgrades

  • github.com/patrickcping/pingone-go-sdk-v2/management v0.63.0

Testing

This PR has been tested with:

  • Unit tests (please paste commands and results below)
  • Acceptance tests (please paste commands and results below)
  • End-to-end tests (please paste the link to the actions workflow runs)
  • Not applicable (no evidences needed)

Shell Command(s)

TF_ACC=1 go test -count=1 -run='TestAccRateLimitConfiguration' -v

Testing Results

Expand Results
=== RUN   TestAccRateLimitConfiguration_RemovalDrift
=== PAUSE TestAccRateLimitConfiguration_RemovalDrift
=== RUN   TestAccRateLimitConfiguration_Full
=== PAUSE TestAccRateLimitConfiguration_Full
=== RUN   TestAccRateLimitConfiguration_ValidationChecks
=== PAUSE TestAccRateLimitConfiguration_ValidationChecks
=== RUN   TestAccRateLimitConfiguration_BadParameters
=== PAUSE TestAccRateLimitConfiguration_BadParameters
=== CONT  TestAccRateLimitConfiguration_RemovalDrift
=== CONT  TestAccRateLimitConfiguration_ValidationChecks
=== CONT  TestAccRateLimitConfiguration_BadParameters
=== CONT  TestAccRateLimitConfiguration_Full
--- PASS: TestAccRateLimitConfiguration_ValidationChecks (1.87s)
--- PASS: TestAccRateLimitConfiguration_BadParameters (9.52s)
--- PASS: TestAccRateLimitConfiguration_Full (52.41s)
--- PASS: TestAccRateLimitConfiguration_RemovalDrift (74.34s)
PASS
ok      github.com/pingidentity/terraform-provider-pingone/internal/service/base        75.048s

End-to-end Tests Workflow Links

  • N/A

@jonathanfuller-pingidentity jonathanfuller-pingidentity requested a review from a team as a code owner December 4, 2025 18:06
@jonathanfuller-pingidentity jonathanfuller-pingidentity marked this pull request as draft December 4, 2025 18:18
Copy link
Contributor

@henryrecker-pingidentity henryrecker-pingidentity left a comment

Choose a reason for hiding this comment

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

Looks good 👍

Copy link
Collaborator

@patrickcping patrickcping left a comment

Choose a reason for hiding this comment

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

Couple of minor things but LGTM 🚀 🚀

grantTypes,
management.EnumApplicationOIDCTokenAuthMethod(plan.TokenEndpointAuthnMethod.ValueString()),
)
data.SetGrantTypes(grantTypes)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's worth migrating this change to #1184

)

createdAtDescription := framework.SchemaAttributeDescriptionFromMarkdown(
"A string that specifies the time the resource was created.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be good to mention the formatting of the date (e.g. "An RFC 3339 formatted string...") for this and updated_at

}

// Save updated data into Terraform state
resp.Diagnostics.Append(data.toState(response)...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to include a if resp.Diagnostics.HasError() ... check between this toState and the following resp.State.Set for the "CRU" operations. I remember seeing an edge case once that led to panic. This check may be on some resources but probably not applied universally yet

},
"DeleteRateLimitConfiguration",
legacysdk.CustomErrorResourceNotFoundWarning,
sdk.DefaultCreateReadRetryable,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably don't need the ..CreateReadRetryable here, nil should work fine on deletes

},
})
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need a func TestAccRateLimitConfiguration_NewEnv(t *testing.T) { ... } test to catch new environment eventual consistency race conditions (see other environment "root level" resources as an example). We do something like it in the "RemovalDrift" test, but that's not the intention of that test so errors can be misinterpreted

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.

4 participants