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

r/attestation_provider: conditionally building the Authorizer as needed and refactoring the Resource #21524

Merged
merged 6 commits into from
Apr 26, 2023

Conversation

tombuildsstuff
Copy link
Contributor

@tombuildsstuff tombuildsstuff commented Apr 24, 2023

Part of reviewing #21509 has identified a number of issues with the PR submitted to add support for this, #20972.

This PR fixes both #21508 - and works to fix some design issues which should have been caught at both implementation and review phase - namely where:

  1. Rather than pre-creating this Authorizer (and failing in Environments where this isn't defined) - we can use the Data Plane URI that's returned from the Resource Manager API to build this up depending on the Environment
  2. Rather than using a List for this and trying to ensure all the environment_type keys are consistent, these should have been exposed as individual fields for each Policy Type - whilst changing that prior to 4.0 would be a breaking change, since we can read these values back from the API (see the next item) this would need to become a Set rather than a List.
  3. The Read method doesn't retrieve these values at all, so we'll never flag there's a diff for these values - although they can be retrieved via the Data Plane endpoint (by specifying the Policy Type, of which there's a known set of values).
  4. Having spent some time investigating how the API behaves however, it appears that the policy block doesn't accurately model the API behaviour - as such we'll need to make these top-level fields instead.
  5. This should be using a Data Plane SDK from tombuildsstuff/kermit (or hashicorp/go-azure-sdk for Resource Manager endpoints) - at this point importing Track1 SDK's is adding technical debt - importing this into either kermit or go-azure-sdk means this doesn't need to be updated later.

This PR addresses most of these issues, with the exception of number 5, which is available via tombuildsstuff/kermit (as of v0.20230424.1090808) - but isn't part of this PR.

Fixes #21508

… fields

This is an unfortunate but intentional breaking change - needed since the `policy` field doesn't
accurately map the API behaviour.
@tombuildsstuff
Copy link
Contributor Author

Tests pass:

Screenshot 2023-04-25 at 09 52 12

@tombuildsstuff tombuildsstuff marked this pull request as ready for review April 25, 2023 10:06
@tombuildsstuff tombuildsstuff requested a review from a team April 25, 2023 10:06
Copy link
Member

@manicminer manicminer left a comment

Choose a reason for hiding this comment

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

LGTM 📘

@tombuildsstuff tombuildsstuff merged commit 841af77 into main Apr 26, 2023
@tombuildsstuff tombuildsstuff deleted the b/attestation-data-plane branch April 26, 2023 10:11
tombuildsstuff added a commit that referenced this pull request Apr 26, 2023
@github-actions
Copy link

This functionality has been released in v3.54.0 of the Terraform 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!

Copy link

github-actions bot commented Jun 2, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging this pull request may close these issues.

Provider version 3.53.0 is not compatible with AzureGov
2 participants