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

Support for Container Group private Key Vault #19741

Open
1 task done
tschechniker opened this issue Dec 20, 2022 · 4 comments
Open
1 task done

Support for Container Group private Key Vault #19741

tschechniker opened this issue Dec 20, 2022 · 4 comments

Comments

@tschechniker
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currenlty the API Version 2021-10-01 is used in the container group resource. The Version 2021-10-01 does not support adding a private Key Vault to the container group. Please update to at least Version 2022-09-01:

https://learn.microsoft.com/azure/container-instances/container-instances-encrypt-data#modify-your-json-deployment-template-1

New or Affected Resource(s)/Data Source(s)

azurerm_container_group

Potential Terraform Configuration

No response

References

https://learn.microsoft.com/azure/container-instances/container-instances-encrypt-data

@sinbai
Copy link
Contributor

sinbai commented Dec 21, 2022

@tschechniker thanks for opening this issue. Per doc , it seems that the private key vault is already supported. Do you mean the identity is not supported?

@tschechniker
Copy link
Author

tschechniker commented Dec 21, 2022

@sinbai no a private keyvault ( a keyvault which is only accessable over it's private endpoint) is currently not supported. You can add a keyvault to use CMK but the Keyvault needs to be public accessable (Otherwise you will see this error: Code="MasterKeyNotAccessibleException" Message="The key vault key is not found to unwrap the encryption key.") If you want to use a private Keyvault with network acl set to bypass AzureServices you have to create the container group using API Version 2022-09-01 and add the identity to the encryption block.

@phoehnel
Copy link

phoehnel commented Oct 5, 2023

I can confirm this is still an issue in hashicorp/azurerm v3.75.0. Strange is, that it should actually work since in #22804 @tombuildsstuff merged the update to the 2023-05-01 API-Version for Container Apps which should support the feature.

Nevertheless, deploying the same configuration without CMK works, when i enable CMK i get the following error. Note that the error message is different from the intial "MasterKeyNotAccessibleException".

│ Error: creating Container Group (Subscription: "1234"
│ Resource Group Name: "rg-xxx-lab"
│ Container Group Name: "aci-xxx-lab"): performing ContainerGroupsCreateOrUpdate: containerinstance.ContainerInstanceClient#ContainerGroupsCreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="Failed" Message="The async operation failed."
│ 
│   with module.workload.module.aci[0].azurerm_container_group.this,

Noteworthy, that currently this also does not work for me using the Azure Portal.
It seems that, at least for me, the portal uses an API Version from 2019 per Default resulting in an error with a different message.

image

@phoehnel
Copy link

phoehnel commented Oct 6, 2023

Update: Something around Container Instances seems incredibly unreliable. I have made tests in which the same terraform configuration would apply successfully 10+ times then without any change, fail with the above async error for a couple of times and then again work. Since thats about the only error i ever got, its also hard to debug this as you cant tell if an error is related to the configuration or it's just random.

Nevertheless, i narrowed the problem by never getting a succesfull deployment using a Private Premium KeyVault in combination with a RSA-HSM key. Using a Private Standard-KeyVault with an RSA-Key i managed to deploy successfully a couple of times.

Noteworthy that we now have 3 ACI-Instances in our tenant which list in the RG/Subscription, but if you click on them you'll get an 404. Seems like - at least for us - everything around ACI isn't as stable as you might expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants