Skip to content

Conversation

@henryrecker-pingidentity
Copy link
Contributor

Change Description

Add beta resources pingone_davinci_application_secret and pingone_davinci_application_key

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

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 TESTACC_BETA=true go test -tags=beta -v -timeout 300s -run ^TestAccDavinciApplicationSecret github.com/pingidentity/terraform-provider-pingone/internal/service/davinci
TF_ACC=1 TESTACC_BETA=true go test -tags=beta -v -timeout 300s -run ^TestAccDavinciApplicationKey github.com/pingidentity/terraform-provider-pingone/internal/service/davinci

Testing Results

Some failures due to typical access failed issues with davinci in tests that create new environments

Expand Results
=== RUN   TestAccDavinciApplicationSecret_RemovalDrift
=== PAUSE TestAccDavinciApplicationSecret_RemovalDrift
=== RUN   TestAccDavinciApplicationSecret_Rotate
=== PAUSE TestAccDavinciApplicationSecret_Rotate
=== RUN   TestAccDavinciApplicationSecret_NewEnv
=== PAUSE TestAccDavinciApplicationSecret_NewEnv
=== RUN   TestAccDavinciApplicationSecret_BadParameters
=== PAUSE TestAccDavinciApplicationSecret_BadParameters
=== CONT  TestAccDavinciApplicationSecret_RemovalDrift
=== CONT  TestAccDavinciApplicationSecret_NewEnv
=== CONT  TestAccDavinciApplicationSecret_Rotate
=== CONT  TestAccDavinciApplicationSecret_BadParameters
--- PASS: TestAccDavinciApplicationSecret_BadParameters (10.94s)
--- PASS: TestAccDavinciApplicationSecret_Rotate (26.55s)
=== NAME  TestAccDavinciApplicationSecret_NewEnv
    resource_davinci_application_secret_test.go:170: Step 1/1 error: Error running apply: exit status 1

        Error: Error when calling `RotateDavinciApplicationSecret`: The request could not be completed. You do not have access to this resource.

          with pingone_davinci_application_secret.qxmnfoozry,
          on terraform_plugin_test.tf line 55, in resource "pingone_davinci_application_secret" "qxmnfoozry":
          55: resource "pingone_davinci_application_secret" "qxmnfoozry" {

        PingOne Error Details:
        Code:		ACCESS_FAILED
        Message:	The request could not be completed. You do not have access to this
        resource.

--- FAIL: TestAccDavinciApplicationSecret_NewEnv (38.13s)
--- PASS: TestAccDavinciApplicationSecret_RemovalDrift (76.68s)
FAIL
FAIL	github.com/pingidentity/terraform-provider-pingone/internal/service/davinci	77.165s
FAIL



=== RUN   TestAccDavinciApplicationKey_RemovalDrift
=== PAUSE TestAccDavinciApplicationKey_RemovalDrift
=== RUN   TestAccDavinciApplicationKey_Rotate
=== PAUSE TestAccDavinciApplicationKey_Rotate
=== RUN   TestAccDavinciApplicationKey_NewEnv
=== PAUSE TestAccDavinciApplicationKey_NewEnv
=== RUN   TestAccDavinciApplicationKey_BadParameters
=== PAUSE TestAccDavinciApplicationKey_BadParameters
=== CONT  TestAccDavinciApplicationKey_RemovalDrift
=== CONT  TestAccDavinciApplicationKey_NewEnv
=== CONT  TestAccDavinciApplicationKey_BadParameters
=== CONT  TestAccDavinciApplicationKey_Rotate
--- PASS: TestAccDavinciApplicationKey_BadParameters (10.45s)
--- PASS: TestAccDavinciApplicationKey_Rotate (26.18s)
--- PASS: TestAccDavinciApplicationKey_NewEnv (42.52s)
=== NAME  TestAccDavinciApplicationKey_RemovalDrift
    resource_davinci_application_key_test.go:42: Step 3/4 error: Error running post-apply refresh plan: exit status 1

        Error: Error when calling `GetDavinciApplicationById`: The request could not be completed. You do not have access to this resource.

          with pingone_davinci_application.qckajsgjcc,
          on terraform_plugin_test.tf line 50, in resource "pingone_davinci_application" "qckajsgjcc":
          50: resource "pingone_davinci_application" "qckajsgjcc" {

        PingOne Error Details:
        Code:		ACCESS_FAILED
        Message:	The request could not be completed. You do not have access to this
        resource.

--- FAIL: TestAccDavinciApplicationKey_RemovalDrift (48.87s)
FAIL
FAIL	github.com/pingidentity/terraform-provider-pingone/internal/service/davinci	49.378s
FAIL

End-to-end Tests Workflow Links

@henryrecker-pingidentity henryrecker-pingidentity requested a review from a team as a code owner December 1, 2025 21:40
@patrickcping
Copy link
Collaborator

patrickcping commented Dec 16, 2025

@henryrecker-pingidentity I see the test results have failures due to new environment race conditions - are these now resolved and the test results are out of date?

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 points, then LGTM 🚀 🚀


type davinciApplicationKeyResourceModel struct {
ApiKey types.Object `tfsdk:"api_key"`
ApplicationId types.String `tfsdk:"application_id"`
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 refer to this as davinci_application_id in the flow policy resource so we have an inconsistency - just checking this and the flow policy attribute that represents the same ID value are inconsistent in the API and it's not something we've introduced?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't really have a "name" in the API since it is used as part of the path, rather than in any json body. In the generator I generate these IDs based on the last word only + "_id", which is why this ends up as "application_id". The docs do refer to this as davinciApplicationID though.

objectplanmodifier.UseStateForUnknown(),
},
},
"application_id": schema.StringAttribute{
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a custom type for DV IDs

stringplanmodifier.RequiresReplace(),
},
},
"environment_id": schema.StringAttribute{
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is framework.Attr_LinkID for consistency

stringvalidator.RegexMatches(regexp.MustCompile("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"), "Must be a valid UUID"),
},
},
"id": schema.StringAttribute{
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is framework.Attr_ID for consistency

},
"RotateDavinciApplicationApiKey",
framework.DefaultCustomError,
framework.DefaultRetryable,
Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultCreateRead..

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.

3 participants