feat: Implement support for KMS arguments#288
feat: Implement support for KMS arguments#288lonegunmanb merged 10 commits intoAzure:masterfrom swisspost:feature/secrets_kms_encryption
Conversation
There was a problem hiding this comment.
Thanks @mkilchhofer for opening this pr and submitting a new resource pr to terraform-azurerm-provider's repo, I've left some comments on provider's pr, once the pr has been merged into the provider, we can continue the code review for this pr.
Btw the review comments for your provider's pr are my personal suggestions, there's no guarantee that your pr would be accepted by HashiCorp if you accepted my suggestion.
| } | ||
| } | ||
| dynamic "key_vault_kms" { | ||
| for_each = var.key_vault_kms_enabled ? ["key_vault_kms"] : [] |
There was a problem hiding this comment.
Since we could turn enabled to false meanwhile keeping this key_vault_kms, I would recommend the following toggle expression:
for_each = var.key_vault_kms_enabled != null ? ["key_vault_kms"] : []There was a problem hiding this comment.
refactored this anyways (source was the upstream implementation)
|
PR is now updated after the upstream provider PR got merged AND released ;-) @lonegunmanb can you please review again? |
lonegunmanb
left a comment
There was a problem hiding this comment.
Thanks @mkilchhofer for updating this pr, some issues need to be solved.
It would be nice if we could have an new example to demonstrate this new feature. We have already created a KeyValut in startup example, but for disk encryption key management for now, would you please estimate whether if we can make that KeyVault work for this new feature? We might need to update azurerm provider's restriction in providers.tf file in startup folder. Or we can just crate a new example folder to do so, your call.
Again, thanks for your contribution!
|
I cannot test the examples as we @swisspost have no subscriptions which allows usage of public IPs. |
|
@mkilchhofer I can do that ! thanks |
|
@mkilchhofer could you please run the You patched the example and you have duplicated definitions for |
- nullable=false on `kms_enabled` - Validate kms_enabled and UserAssigned identity
zioproto
left a comment
There was a problem hiding this comment.
Could you patch only the named_cluster example ?
We dont need to the KMS in the others, it would also require more work because the needed UserAssigned identity_type is not set in the others. Thanks
|
commit 7012178 is now passing both @lonegunmanb could you please review and run the e2e tests ? thanks |
|
@lonegunmanb can you trigger E2E again? 😇 |
lonegunmanb
left a comment
There was a problem hiding this comment.
Thanks @mkilchhofer for this update, we've met some issues when we ran the test.
We've added network_acl on the KeyVault to restrict the source IP which can access this Key Vault, but the Aks's public IP is unpredictable so the original code would meet a 403 error.
We need config the aks to access the KeyVault via private network as this document described.
| rbac_aad = true | ||
| rbac_aad_managed = true | ||
| role_based_access_control_enabled = true | ||
|
|
There was a problem hiding this comment.
We need the following line below line 31:
service_endpoints = ["Microsoft.KeyVault"]There was a problem hiding this comment.
Service endpoint is not needed (at least in our scenario). I think its only needed if some part inside the VNET wants to access the keyvault.
lonegunmanb
left a comment
There was a problem hiding this comment.
Thanks @mkilchhofer, LGTM! 🚀
|
Thanks alot for your patience with me 👍 |
Describe your changes
This implements Add Key Management Service (KMS) etcd encryption to an Azure Kubernetes Service (AKS) cluster.
Feature is not yet available in azurerm provider, but also opened a PR over there:
azurerm_kubernetes_cluster- Support for KMS arguments hashicorp/terraform-provider-azurerm#19893Issue number
-Checklist before requesting a review
CHANGELOG.mdfileThanks for your cooperation!