Azure/PSRule.Rules.Azure

[BUG] Symbolic expand for existing with conditional cases

BernieWhite opened this issue · 1 comments

Existing rule

No response

Description of the issue

Better handling when references are not used.

For example, the existing reference could fail with index out of bounds but it should not be called when identityId is empty, but is because it is defined as a resource instead of a reference.

Error messages

No response

Reproduction

@sys.description('Reference a user-assigned managed identity.')
resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2022-01-31-preview' existing = {
  scope: resourceGroup(split(identityId, '/')[4])
  name: split(identityId, '/')[8]
}

Version of PSRule

2.9.0

Version of PSRule for Azure

1.36.0

Additional context

No response

Further example here #3013