One thing of note is that the values in auth0_connection.options[0].configuration are encrypted so the resource uses the values from the local state instead of what's returned by auth0. Since the data source doesn't have local state, the configuration object is empty. I made a note in the docs about that. We may want to consider storing the encrypted values as well under configuration_encrypted for drift detection.
Acceptance Test Output
$ make testacc TESTARGS="-run TestAccDataSourceConnection"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./auth0 -v -count 1 -parallel 10 -run TestAccDataSourceConnection -timeout 15m -coverprofile="c.out"
=== RUN TestAccDataSourceConnection
--- PASS: TestAccDataSourceConnection (15.45s)
=== RUN TestAccDataSourceConnection_NonPersistentAttrs
--- PASS: TestAccDataSourceConnection_NonPersistentAttrs (8.40s)
=== RUN TestAccDataSourceConnectionAD
--- PASS: TestAccDataSourceConnectionAD (4.54s)
=== RUN TestAccDataSourceConnectionAzureAD
--- PASS: TestAccDataSourceConnectionAzureAD (5.11s)
=== RUN TestAccDataSourceConnectionOIDC
--- PASS: TestAccDataSourceConnectionOIDC (8.63s)
=== RUN TestAccDataSourceConnectionOAuth2
--- PASS: TestAccDataSourceConnectionOAuth2 (12.65s)
=== RUN TestAccDataSourceConnectionWithEnabledClients
--- PASS: TestAccDataSourceConnectionWithEnabledClients (12.11s)
=== RUN TestAccDataSourceConnectionSMS
--- PASS: TestAccDataSourceConnectionSMS (4.72s)
=== RUN TestAccDataSourceConnectionEmail
--- PASS: TestAccDataSourceConnectionEmail (8.57s)
=== RUN TestAccDataSourceConnectionSalesforce
--- PASS: TestAccDataSourceConnectionSalesforce (4.11s)
=== RUN TestAccDataSourceConnectionGoogleOAuth2
--- PASS: TestAccDataSourceConnectionGoogleOAuth2 (5.29s)
=== RUN TestAccDataSourceConnectionFacebook
--- PASS: TestAccDataSourceConnectionFacebook (8.10s)
=== RUN TestAccDataSourceConnectionApple
--- PASS: TestAccDataSourceConnectionApple (7.86s)
=== RUN TestAccDataSourceConnectionLinkedin
--- PASS: TestAccDataSourceConnectionLinkedin (9.45s)
=== RUN TestAccDataSourceConnectionGitHub
--- PASS: TestAccDataSourceConnectionGitHub (4.11s)
=== RUN TestAccDataSourceConnectionWindowslive
--- PASS: TestAccDataSourceConnectionWindowslive (8.64s)
=== RUN TestAccDataSourceConnection_SAML
--- PASS: TestAccDataSourceConnection_SAML (7.65s)
PASS
coverage: 22.7% of statements
ok github.com/alekc/terraform-provider-auth0/auth0 135.577s coverage: 22.7% of statements
Community Note
Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request
Checklist
[x] All added fields have proper documentation properties set up
[x] All tests are passing
[x] Any new code is covered by test coverage
[x] Example files (in /example folder) have been amended
Proposed Changes
auth0_connection
resource_data.go
One thing of note is that the values in
auth0_connection.options[0].configuration
are encrypted so the resource uses the values from the local state instead of what's returned by auth0. Since the data source doesn't have local state, the configuration object is empty. I made a note in the docs about that. We may want to consider storing the encrypted values as well underconfiguration_encrypted
for drift detection.Acceptance Test Output
Community Note
Checklist