Created
December 19, 2024 15:22
-
-
Save skarllot/03424150ac1a8a9f1aca1e87f350f4fd to your computer and use it in GitHub Desktop.
Example condition that does not work on Bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource natGateway 'Microsoft.Network/natGateways@2023-11-01' = if (hasNatGateway) { | |
name: natGatewayName | |
location: location | |
sku: { | |
name: 'Standard' | |
} | |
} | |
resource subnets 'Microsoft.Network/virtualNetworks/subnets@2022-11-01' = { | |
name: name | |
parent: virtualNetwork | |
properties: { | |
addressPrefix: addressPrefix | |
natGateway: hasNatGateway | |
? { | |
id: natGateway.id | |
} | |
: null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The solution is duplicating subnet resource with condition on each