Open cedricbraekevelt opened 8 months ago
Any updates/tips @alex-frankel
@stephaniezyen @alex-frankel am I missing something in my logic or is this just not possible at this moment?
Sorry about the delay here @cedricbraekevelt. This one just kept falling off my radar.
If I however declare the vpnConnections as a seperate child resource, in a seperate module, It works, but recreates the vpn's on each deployment (downtime).
I think this part is the most interesting. connections
is another one of those "dual-modelled" properties/child resources and the right long-term fix is to allow redeployment of vpnGateways
without affecting the state of connections
if connections
is NOT declared in the parent resource. I'm going to circulate this with the Networking RP team to see if they are up for this change. Adding @ramandhillon84 as FYI.
In the meantime, I think you have already implemented the "least-bad" solution.
As an aside, can you help us understand the use of both the safe-dereference operator (?
) and null-forgiving (!
)?
Hi @alex-frankel ,
Thanks for the reply!
The reason I'm using both the ? and ! is because in some edge cases I've had to use them where the output of an expression is used in another expression which resulted in an error. Since them I've began using them both everywhere, maybe not a best practise.
Started a discussion with the VPN Gateway team. Will update you on any responses I get.
Any update on this @alex-frankel?
We are currently doing it like this:
@secure()
param vpnLinkConnection1Secret string
@secure()
param vpnLinkConnection2Secret string
var secrets = [
vpnLinkConnection1Secret
vpnLinkConnection2Secret
]
....
vpnLinkConnections: [for link, i) in vpnLinkConnections: {
name: link.name
properties: {
...
sharedkey: secrets[i]
...
}
}
which is in no way dynamic.
Bicep version Bicep CLI version 0.25.53 (c0ad57dff6)
Describe the bug
If we would be able to use keyvault.getsecret() in the params of a resource this would solve the problem. But at this moment it's only possible as the value of a secure parameter. (or use getsecret everywhere)
Am i forgetting something?
As a workaround I'm using a module which outputs the secret in clear text and returns it as an array towards the vpnGateway. The choices were: