-
Notifications
You must be signed in to change notification settings - Fork 87
FEAT: Added KeyVaultSecret Datasource #516
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
base: main
Are you sure you want to change the base?
Conversation
3ae5b90
to
6a80f58
Compare
906d6f8
to
0e18857
Compare
d9d3324
to
2b415f7
Compare
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.
Nice work Tanmay, this is looking really good. I think we need to re-think some of the authentication logic and bring it more in line with the how the builders work, as I think this will be a better user experience, please let me know what you think!
|
||
client_id = var.client_id | ||
client_secret = var.client_secret | ||
tenant_id = var.tenant_id |
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 had to add subscription_id here after the changes to use the existing authorizer
"github.com/Azure/azure-sdk-for-go/sdk/azcore" | ||
"github.com/Azure/azure-sdk-for-go/sdk/azidentity" | ||
"github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets" |
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.
Do we still need to use the azure-sdk-for-go here? I assume you just haven't updated this acceptance test since migrating to the new strategy for solving this
@@ -52,6 +52,25 @@ resource "azurerm_shared_image" "linux-sig" { | |||
} | |||
} | |||
|
|||
resource "azurerm_key_vault" "vault" { | |||
name = "packer-acctest-vault" |
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.
Right now if two developers are working on the plugin, or if CI is running when a developer is working, this can cause conflict, you should use the resource prefix for resources that have unique name across subscription, which I think key vaults are at least subscription wide for unique names, since we ran into that error before
name = "packer-acctest-vault" | |
name = "${var.resource_prefix}-pkr-test-vault" |
This pull request introduces a new Key Vault data source for the Azure Packer plugin, enabling users to retrieve secrets from Azure Key Vault.
vault_name
[required]secret_name
[required]version
NOTE: Unlike the rest of the plugin, which uses the Hashicorp's
go-azure-sdk
, this change uses Azure's own sdk. This is done since the Hashicorp's azure sdk does not provide a support for fetching the value of the secret and only uses the ARM APIs, which only provides us with the properties of the secret and not the value.Closes #71