.claude/worktrees/agent-a920ebd2f97275b33/manifests/collectors/Containers/ContainerApp.psd1
|
# # GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Containers/ContainerApp.ps1 (AB#5660). # Field expressions are copied verbatim from the original collector and evaluate in an # equivalent scope -- see docs/design/decisions/declarative-collectors.md. # Review before trusting; regenerate rather than hand-patch if the source collector changes. # @{ ResourceTypes = @( 'microsoft.app/containerapps' ) ResourceTypeMatching = 'Grouped' AdditionalFilter = $null FilterPreamble = '' RowLoopVariable = '1' Preamble = @' $ResUCount = 1 $sub1 = $SUB | Where-Object { $_.id -eq $1.subscriptionId } $data = $1.PROPERTIES $Retired = $Retirements | Where-Object { $_.id -eq $1.id } if ($Retired) { $RetiredFeature = foreach ($Retire in $Retired) { $RetiredServiceID = $Unsupported | Where-Object {$_.Id -eq $Retired.ServiceID} $tmp0 = [pscustomobject]@{ 'RetiredFeature' = $RetiredServiceID.RetiringFeature 'RetiredDate' = $RetiredServiceID.RetirementDate } $tmp0 } $RetiringFeature = if (@($RetiredFeature.RetiredFeature).count -gt 1) { $RetiredFeature.RetiredFeature | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredFeature} $RetiringFeature = [string]$RetiringFeature $RetiringFeature = if ($RetiringFeature -like '* ,*') { $RetiringFeature -replace ".$" }else { $RetiringFeature } $RetiringDate = if (@($RetiredFeature.RetiredDate).count -gt 1) { $RetiredFeature.RetiredDate | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredDate} $RetiringDate = [string]$RetiringDate $RetiringDate = if ($RetiringDate -like '* ,*') { $RetiringDate -replace ".$" }else { $RetiringDate } } else { $RetiringFeature = $null $RetiringDate = $null } $Tags = if(![string]::IsNullOrEmpty($1.tags.psobject.properties)){$1.tags.psobject.properties}else{'0'} $ingress = if(![string]::IsNullOrEmpty($data.configuration.ingress)){$true}else{$false} $dapr = if(![string]::IsNullOrEmpty($data.configuration.dapr)){$true}else{$false} $secrets = if(![string]::IsNullOrEmpty($data.configuration.secrets)){@($data.configuration.secrets).count}else{0} $Env = $data.environmentId.split('/')[8] '@ AdditionalRowLoops = @( @{ Variable = '2' Source = '$data.template' Preamble = '' } @{ Variable = '3' Source = '$2.containers' Preamble = '' } ) TagLoop = @{ Variable = 'Tag' Source = '$Tags' Preamble = '' } Fields = @( @{ Name = 'ID' Expression = '$1.id' } @{ Name = 'Subscription' Expression = '$sub1.Name' } @{ Name = 'Resource Group' Expression = '$1.RESOURCEGROUP' } @{ Name = 'Name' Expression = '$1.NAME' } @{ Name = 'Location' Expression = '$1.LOCATION' } @{ Name = 'Retiring Feature' Expression = '$RetiringFeature' } @{ Name = 'Retiring Date' Expression = '$RetiringDate' } @{ Name = 'Running Status' Expression = '$data.runningStatus' } @{ Name = 'Container App Environment' Expression = '$Env' } @{ Name = 'Workload Profile' Expression = '$data.workloadProfileName' } @{ Name = 'Ingress' Expression = '$ingress' } @{ Name = 'Ingress Port' Expression = '$data.configuration.ingress.targetPort' } @{ Name = 'External Ingress' Expression = '$data.configuration.ingress.external' } @{ Name = 'Insecure Connections' Expression = '$data.configuration.ingress.allowInsecure' } @{ Name = 'Ingress Transport' Expression = '$data.configuration.ingress.transport' } @{ Name = 'Dapr' Expression = '$dapr' } @{ Name = 'Secrets' Expression = '[string]$secrets' } @{ Name = 'Container' Expression = '$3.name' } @{ Name = 'CPU Cores' Expression = '$3.resources.cpu' } @{ Name = 'Memory Size (Gi)' Expression = '$3.resources.memory' } @{ Name = 'Ephemeral Storage (Gi)' Expression = '$3.resources.ephemeralStorage' } @{ Name = 'Container Image' Expression = '$3.image' } @{ Name = 'Resource U' Expression = '$ResUCount' } @{ Name = 'Tag Name' Expression = '[string]$Tag.Name' } @{ Name = 'Tag Value' Expression = '[string]$Tag.Value' } ) Export = @{ WorksheetName = 'Container Apps' TableNamePrefix = 'ContsTb_' Columns = @( 'Subscription' 'Resource Group' 'Name' 'Location' 'Retiring Feature' 'Retiring Date' 'Running Status' 'Container App Environment' 'Workload Profile' 'Ingress' 'Ingress Port' 'External Ingress' 'Insecure Connections' 'Ingress Transport' 'Dapr' 'Secrets' 'Container' 'CPU Cores' 'Memory Size (Gi)' 'Ephemeral Storage (Gi)' 'Container Image' 'Resource U' ) TagColumns = @( 'Tag Name' 'Tag Value' ) TagColumnsBefore = 'Resource U' NumberFormat = '0' ConditionalText = @( 'New-ConditionalText -Range E2:E100 -ConditionalType ContainsText' 'New-ConditionalText true -Range L:L -ConditionalType ContainsText' 'New-ConditionalText true -Range M:M -ConditionalType ContainsText' ) } SourceCollector = 'Modules/Public/InventoryModules/Containers/ContainerApp.ps1' } |