Skip to content

Help with a array with multiple conditions. #12987

Closed Answered by anthony-c-martin
GBCSIM1 asked this question in General
Discussion options

You must be logged in to vote

Without seeing a more complete sample, it's hard to know exactly what to recommend, but something like the following should work - essentially using the union() function to construct an array with multiple entries:

module resourceGroupNetworking 'modules/resourcegroup.bicep' = {
  name: networkingResourceGroupName
  scope: subscription()
  params: {
    name: networkingResourceGroupName
    location: location
    roleAssignments: union(
      contains(subnetNames, 'aks') ? [
        {
          description: 'aks umi network contributor ccc'
          principalIds: contains(subnetNames, 'aks') ? [
            aksUMI01.outputs.principalld
          ] : []
          principalType: 'ServicePr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GBCSIM1
Comment options

Answer selected by GBCSIM1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants