Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullable parameters for built-in types #2488

Closed
BernieWhite opened this issue Oct 17, 2023 · 0 comments · Fixed by #2497
Closed

Nullable parameters for built-in types #2488

BernieWhite opened this issue Oct 17, 2023 · 0 comments · Fixed by #2497
Assignees
Labels
bug Something isn't working feature: pre-flight-expansion Issues relating to expansion of ARM and Bicep.
Milestone

Comments

@BernieWhite
Copy link
Collaborator

BernieWhite commented Oct 17, 2023

Existing rule

No response

Description of the issue

When nullable parameters are defined in a module and the consuming module does not pass through a value (resulting in a null) an expansion error is raised.

The problem is also experienced with custom types, however there is some additional complexity so a separate issue will track the case for custom types #2489.

Error messages

The parameter named 'minTLSVersion' was not set or a defaultValue was defined.

Reproduction

param minTLSVersion string?

resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = {
  name: 'test'
  #disable-next-line no-loc-expr-outside-params
  location: resourceGroup().location
  sku: {
    name: 'Standard_LRS'
  }
  kind: 'StorageV2'
  properties: {
    minimumTlsVersion: minTLSVersion ?? 'TLS1_2'
  }
}

Version of PSRule

2.9.0

Version of PSRule for Azure

1.30.2

Additional context

Raised by @AlexanderSehr in microsoft/PSRule#1640

@BernieWhite BernieWhite added bug Something isn't working feature: pre-flight-expansion Issues relating to expansion of ARM and Bicep. labels Oct 17, 2023
@BernieWhite BernieWhite self-assigned this Oct 17, 2023
@BernieWhite BernieWhite added this to the v1.30.3 milestone Oct 17, 2023
BernieWhite added a commit to BernieWhite/PSRule.Rules.Azure that referenced this issue Oct 17, 2023
This was referenced Oct 19, 2023
BernieWhite added a commit that referenced this issue Oct 19, 2023
* Fixes nullable param for built-in types #2488 (#2490)

* Release v1.30.3 (#2495)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature: pre-flight-expansion Issues relating to expansion of ARM and Bicep.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant