Skip to content

Commit

Permalink
UniqueID bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Jan 10, 2024
1 parent 6289de8 commit 09ce1df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Fixed issue where the UniqueId parameter was added incorrectly for resources that had the IsSingleInstance parameter

## [0.1.12] - 2024-01-02

### Added
Expand Down
6 changes: 5 additions & 1 deletion source/Public/New-CompositeResourceModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@ function New-CompositeResourceModule

$script:currentDepth = 0

if ($filteredProperties.Name -notcontains "Id" -and $filteredProperties.Name -notcontains "Identity" -and $filteredProperties.Name -notcontains "IsSingleInstance")
# Check if the resource needs a UniqueId parameter by checking if the names of the properties contain
# any of the below property names. If they don't, a UniqueId is required.
$propertiesNeedUniqueId = @("Id", "Identity", "IsSingleInstance")
$diff = Compare-Object -ReferenceObject $filteredProperties.Name -DifferenceObject $propertiesNeedUniqueId -ExcludeDifferent -IncludeEqual
if ($null -eq $diff)
{
$currentDataObject.UniqueId = ('{0} | {1} | {2}' -f "String", "Required", "Unique ID to identify this specific object")
}
Expand Down

0 comments on commit 09ce1df

Please sign in to comment.