Skip to content

Commit

Permalink
fix: Fix for attributes in key-vault/vault #2758 (#3039)
Browse files Browse the repository at this point in the history
## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

Closes #2758

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.key-vault.vault](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=anchor)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [x] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [x] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [x] I'm sure there are no other open Pull Requests for the same
update/change
- [x] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [x] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
ChrisSidebotham authored Aug 13, 2024
1 parent 0451dba commit 2fd6702
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions avm/res/key-vault/vault/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ module keyVault_secrets 'secret/main.bicep' = [
name: secret.name
value: secret.value
keyVaultName: keyVault.name
attributesEnabled: secret.?attributesEnabled
attributesExp: secret.?attributesExp
attributesNbf: secret.?attributesNbf
attributesEnabled: secret.?attributes.?enabled
attributesExp: secret.?attributes.?exp
attributesNbf: secret.?attributes.?nbf
contentType: secret.?contentType
tags: secret.?tags ?? tags
roleAssignments: secret.?roleAssignments
Expand All @@ -286,9 +286,9 @@ module keyVault_keys 'key/main.bicep' = [
params: {
name: key.name
keyVaultName: keyVault.name
attributesEnabled: key.?attributesEnabled
attributesExp: key.?attributesExp
attributesNbf: key.?attributesNbf
attributesEnabled: key.?attributes.?enabled
attributesExp: key.?attributes.?exp
attributesNbf: key.?attributes.?nbf
curveName: (key.?kty != 'RSA' && key.?kty != 'RSA-HSM') ? (key.?curveName ?? 'P-256') : null
keyOps: key.?keyOps
keySize: (key.?kty == 'RSA' || key.?kty == 'RSA-HSM') ? (key.?keySize ?? 4096) : null
Expand Down
14 changes: 7 additions & 7 deletions avm/res/key-vault/vault/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "17375579299346578014"
"templateHash": "4127506616814902143"
},
"name": "Key Vaults",
"description": "This module deploys a Key Vault.",
Expand Down Expand Up @@ -1445,13 +1445,13 @@
"value": "[parameters('name')]"
},
"attributesEnabled": {
"value": "[tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'attributesEnabled')]"
"value": "[tryGet(tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'attributes'), 'enabled')]"
},
"attributesExp": {
"value": "[tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'attributesExp')]"
"value": "[tryGet(tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'attributes'), 'exp')]"
},
"attributesNbf": {
"value": "[tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'attributesNbf')]"
"value": "[tryGet(tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'attributes'), 'nbf')]"
},
"contentType": {
"value": "[tryGet(coalesce(parameters('secrets'), createArray())[copyIndex()], 'contentType')]"
Expand Down Expand Up @@ -1732,13 +1732,13 @@
"value": "[parameters('name')]"
},
"attributesEnabled": {
"value": "[tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributesEnabled')]"
"value": "[tryGet(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributes'), 'enabled')]"
},
"attributesExp": {
"value": "[tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributesExp')]"
"value": "[tryGet(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributes'), 'exp')]"
},
"attributesNbf": {
"value": "[tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributesNbf')]"
"value": "[tryGet(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'attributes'), 'nbf')]"
},
"curveName": "[if(and(not(equals(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'kty'), 'RSA')), not(equals(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'kty'), 'RSA-HSM'))), createObject('value', coalesce(tryGet(coalesce(parameters('keys'), createArray())[copyIndex()], 'curveName'), 'P-256')), createObject('value', null()))]",
"keyOps": {
Expand Down

0 comments on commit 2fd6702

Please sign in to comment.