-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_synapse_workspace - support for the customer_managed_key_versionless_id
property
#11328
azurerm_synapse_workspace - support for the customer_managed_key_versionless_id
property
#11328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allantargino, thank you so much for the PR. It's looking good so far but I left a few minor comments and questions. Once we get those addressed we can get this merged and shipped in the next release! 🚀
Requested Change:
Can we actually pull this out of the azurerm_synapse_workspace
resource and make it its own separate azurerm_synapse_workspace_customer_managed_key
resource to be more consistent with the already existing implementations of this functionality? (e.g. azurerm_storage_account_customer_managed_key
, azurerm_log_analytics_cluster_customer_managed_key
, etc.)
azurerm/internal/services/synapse/synapse_workspace_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/synapse/synapse_workspace_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/synapse/synapse_workspace_resource.go
Outdated
Show resolved
Hide resolved
key_vault { | ||
purge_soft_delete_on_destroy = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for disabling the purge_soft_delete_on_destroy
feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it because I keep receive the following error message:
The user, group or application 'appid=...;oid=...;iss=https://sts.windows.net/.../' does not have keys purge permission on key vault 'acckv210422144256592239;location=...'
Even though I set the permissions on the KV terraform code:
access_policy {
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = data.azurerm_client_config.current.object_id
key_permissions = [
"create",
"get",
"delete",
"purge"
]
}
@allantargino, to get rid of the CI error you may need to pull the origin/master branch into your fork. |
Hi @WodansSon, thanks for reviewing the PR! I first was trying to implement You can only specify whether you need double encryption or not when you are creating the resource. If you opted for it, you need to pass a key vault key on the body of the request. Otherwise, you won't be able to update Synapse to use double encryption after the workspace has been created. So that's why I chose to embed it :( Please check this documentation.
Also, check how the portal shows it up: How about using the current interface and, if/when the Synapse team updates this behavior, we deprecate it in favor of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @allantargino - LGTM 👍
customer_managed_key_versionless_id
property
This has been released in version 2.57.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.57.0"
}
# ... other configuration ... |
It doe snot work as it needs grant to be done to managed identity to the AKV 2021-05-05 18:25:10 Azure Synapse Encryption can only be enabled during creation time for some unknown reason. MS document says activation can only be done manually:- So this feature doe snot work with terraform and need to be relloked. I can grant MSI access in my module resource "azurerm_key_vault_access_policy" "instance" { key_vault_id = var.keyvault_id But issue is Synapse is still getting created and it just fails and there is not az command to activate it. Unlike other service Azure SQL, Postgres etc.. which can enable TDE after instance creation, Azure Synapse doe snot allow this. |
This is the Bug which MS has to fix in its ARM template and also in terraform • Create workspace, with CMK set |
Hello, I too am facing the same issue as @sehgalnamit. Error received while trying to create a synapse workspace using customer_managed_key_versionless_id property. **_Error: updating Synapse Workspace "rsgue2fidodasa02" Sql Admin (Resource Group "shared-fido-dev-eastus2"): synapse.WorkspaceAadAdminsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="WorkspaceActivationRequired" Message="Workspace needs to be activated, by adding the managed identity in the KeyVault containing the customer managed key and activating the workspace through the keys subresource." on azure-synapse.tf line 6, in resource "azurerm_synapse_workspace" "synapse": I can assign the key permissions to Managed Identity only once the workspace is deployed and I get the identity's principal ID. But, currently it erroring out while synapse workspace creation. |
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. |
This PR adds support for CMK on Synapse.