https://pulumi.com logo
Title
f

fancy-artist-45287

03/28/2023, 12:01 PM
Hi does anybody know how to fetch an iothub's build in eventhub endpoint with pulumi? I need to get the connectionstring out and put it in a keyvault
m

melodic-tomato-39005

03/28/2023, 2:10 PM
devices.getIotHubResource
returns a result with eventHubEndpoints. However, for putting the endpoint in a vault you might need to use the Azure Key Vault directly, since Pulumi is meant to manage resources, not objects in the data plane.
f

fancy-artist-45287

03/28/2023, 2:55 PM
Thanks @melodic-tomato-39005, but what do you mean use the Azure Key Vault directly? Do you mean manually? How would you else automate it? I am stringing together a lot of resources that need to communicate with each other and if I quickly want to spin up new stack I wouldn't want there to be any manual work involved?
but thanx that worked like a charm
m

melodic-tomato-39005

03/28/2023, 3:32 PM
I meant using the official azure KV SDK in your code, alongside Pulumi.
f

fancy-artist-45287

03/28/2023, 3:36 PM
ah, so this is not recommended? I should use a kv sdk to do so in stead? that would also let me have less resources in pulumi as every secret is now a resource...
new azure.keyvault.Secret(name, {
  name,
  value,
  keyVaultId: this.resource.id,
});
m

melodic-tomato-39005

03/28/2023, 7:17 PM
Actually, it seems like my response was not quite correct. While Pulumi does indeed not support 100% of the KV data plane, it looks like creating secrets should be fine. That being said, if you wouldn’t want your secrets as Pulumi resources, you’re always free to use the KV SDK in parallel to Pulumi.