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

Fix access IDPs not importing config obj #2735

Merged
merged 1 commit into from Sep 5, 2023

Conversation

GreenStage
Copy link
Contributor

@GreenStage GreenStage commented Sep 4, 2023

Fixes #1419

Please DO NOT MERGE until someone from the Cloudflare Access team reviews 🙏

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

changelog detected ✅

@@ -136,7 +137,6 @@ func resourceCloudflareAccessIdentityProviderSchema() map[string]*schema.Schema
},
"redirect_url": {
Type: schema.TypeString,
Optional: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: redirect_url is always set by the API. Values sent by the client are ignored.

Copy link
Member

Choose a reason for hiding this comment

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

should this be Computed then?

Copy link
Contributor Author

@GreenStage GreenStage Sep 5, 2023

Choose a reason for hiding this comment

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

it is 😛 , I just removed the optional

Copy link
Member

Choose a reason for hiding this comment

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

thanks GitHub diffs 🤦‍♂️

@@ -38,6 +38,7 @@ func resourceCloudflareAccessIdentityProviderSchema() map[string]*schema.Schema
"config": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The config object might be generated by the API with some default fields.
(Same for scim-config)

@jroyal
Copy link
Contributor

jroyal commented Sep 5, 2023

Pulled this change down and ran it on my test account. It was able to import the config successfully. LGTM.

@jacobbednarz
Copy link
Member

acceptance tests all good

TF_ACC=1 go test ./internal/sdkv2provider -v -run "^TestAccCloudflareAccessIdentityProvider_" -count 1 -timeout 120m -parallel 1
=== RUN   TestAccCloudflareAccessIdentityProvider_OneTimePin
--- PASS: TestAccCloudflareAccessIdentityProvider_OneTimePin (19.38s)
=== RUN   TestAccCloudflareAccessIdentityProvider_OAuth
=== PAUSE TestAccCloudflareAccessIdentityProvider_OAuth
=== RUN   TestAccCloudflareAccessIdentityProvider_OAuthWithUpdate
=== PAUSE TestAccCloudflareAccessIdentityProvider_OAuthWithUpdate
=== RUN   TestAccCloudflareAccessIdentityProvider_SAML
=== PAUSE TestAccCloudflareAccessIdentityProvider_SAML
=== RUN   TestAccCloudflareAccessIdentityProvider_AzureAD
    provider_test.go:217: Skipping acceptance test for default account (f037e56e89293a057740de681ac9abbe). Pending investigation into automating Azure IDP.
--- SKIP: TestAccCloudflareAccessIdentityProvider_AzureAD (0.00s)
=== RUN   TestAccCloudflareAccessIdentityProvider_OAuth_Import
=== PAUSE TestAccCloudflareAccessIdentityProvider_OAuth_Import
=== CONT  TestAccCloudflareAccessIdentityProvider_OAuth
--- PASS: TestAccCloudflareAccessIdentityProvider_OAuth (8.41s)
=== CONT  TestAccCloudflareAccessIdentityProvider_SAML
--- PASS: TestAccCloudflareAccessIdentityProvider_SAML (8.59s)
=== CONT  TestAccCloudflareAccessIdentityProvider_OAuth_Import
--- PASS: TestAccCloudflareAccessIdentityProvider_OAuth_Import (9.59s)
=== CONT  TestAccCloudflareAccessIdentityProvider_OAuthWithUpdate
--- PASS: TestAccCloudflareAccessIdentityProvider_OAuthWithUpdate (14.65s)
PASS
ok  	github.com/cloudflare/terraform-provider-cloudflare/internal/sdkv2provider	60.969s

@jacobbednarz jacobbednarz merged commit 5594428 into cloudflare:master Sep 5, 2023
9 checks passed
@github-actions github-actions bot added this to the v4.14.0 milestone Sep 5, 2023
github-actions bot pushed a commit that referenced this pull request Sep 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

This functionality has been released in v4.14.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cloudflare_access_identity_provider does not import config block settings
3 participants