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

refactor: splitting ManagedHSM out into it’s own Service Package #24737

Merged
merged 9 commits into from
Feb 2, 2024

Conversation

tombuildsstuff
Copy link
Contributor

Whilst Key Vault and Managed HSM are similar services, they’re now different enough that we should provide logical separations within the codebase to account for that.

In that vain, this PR splits Managed HSM out into it’s own package (managedhsm) meaning that all of that logic is grouped within that package. Doing this helps us ensure that we correctly account for the casing of constants, given this differs between Key Vault and Managed HSM - and is required in order to make the casing consistent within the keyvault package (and migrate that to the newer API version 2023-07-01, which uses hashicorp/go-azure-sdks base layer).

This means that PRs such as #24209 can be scoped to the Managed HSM service - meaning that we won’t unintentionally automatically supporting Managed HSM where a resource only expects Key Vault support.

Copy link
Contributor

@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.

Some goimports to tidy but LGTM

Comment on lines 11 to 12
"github.com/hashicorp/terraform-provider-azurerm/internal/services/managedhsm/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/managedhsm/validate"
Copy link
Contributor

Choose a reason for hiding this comment

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

goimports

This commit splits Managed HSM out into it's own package to provide a logical seperation between this and Key Vault.

Whilst the two services share /some/ of the same APIs, and a similar payload, the values required for these are different
particularly within the Data Plane API.

As such - to provide logical separation between the two and discourage code reuse to avoid subtle/hard-to-diagnose issues
this commit scaffolds out a Service Package for Managed HSM.

Porting the existing resources over will come in a follow up commit.
…r than Key Vault / removing the unused clients
Calling out when these are Data Plane vs Resource Management so this is clearer
@tombuildsstuff tombuildsstuff force-pushed the refactor/managed-hsm-to-its-own-servicepackage branch from 4299fbf to 496ed9a Compare February 2, 2024 14:13
@tombuildsstuff tombuildsstuff merged commit 5f435ec into main Feb 2, 2024
30 checks passed
@tombuildsstuff tombuildsstuff deleted the refactor/managed-hsm-to-its-own-servicepackage branch February 2, 2024 14:42
sinbai pushed a commit to sinbai/terraform-provider-azurerm that referenced this pull request Feb 5, 2024
…m-to-its-own-servicepackage

refactor: splitting `ManagedHSM` out into it’s own Service Package
Copy link

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 Apr 25, 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.

2 participants