manifests/collectors/Networking/ApplicationGateways.psd1
|
# # GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Networking/ApplicationGateways.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.network/applicationgateways' ) ResourceTypeMatching = 'Grouped' AdditionalFilter = $null FilterPreamble = '' RowLoopVariable = '1' SetupPreamble = @' $APPGTW = $Resources | Where-Object { $_.TYPE -eq 'microsoft.network/applicationgateways' } $APPGTWPOL = $Resources | Where-Object { $_.TYPE -eq 'Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies' } '@ SetupVariables = @( 'APPGTW' 'APPGTWPOL' ) Preamble = @' $ResUCount = 1 $sub1 = $SUB | Where-Object { $_.Id -eq $1.subscriptionId } $data = $1.PROPERTIES $Retired = Foreach ($Retirement in $Retirements) { if ($Retirement.id -eq $1.id) { $Retirement } } 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 } if([string]::IsNullOrEmpty($data.autoscaleConfiguration.maxCapacity)){$MaxCap = 'Autoscale Disabled'}else{$MaxCap = $data.autoscaleConfiguration.maxCapacity} if([string]::IsNullOrEmpty($data.autoscaleConfiguration.minCapacity)){$MinCap = 'Autoscale Disabled'}else{$MinCap = $data.autoscaleConfiguration.minCapacity} if([string]::IsNullOrEmpty($data.sslPolicy.minProtocolVersion)){$PROT = 'Default'}else{$PROT = $data.sslPolicy.minProtocolVersion} if([string]::IsNullOrEmpty($data.webApplicationFirewallConfiguration.enabled)){$WAF = 'false'}else{$WAF = $data.webApplicationFirewallConfiguration.enabled} if($WAF -eq 'false' -and $1.id -in $APPGTWPOL.properties.applicationGateways.id){$WAF = 'true'} $BackendState = if(![string]::IsNullOrEmpty($data.backendAddressPools.properties.backendAddresses)){'In Use'}else{'Empty'} $Tags = if(![string]::IsNullOrEmpty($1.tags.psobject.properties)){$1.tags.psobject.properties}else{'0'} '@ AdditionalRowLoops = @() 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 = 'State' Expression = '$data.OperationalState' } @{ Name = 'WAF Enabled' Expression = '$WAF' } @{ Name = 'Minimum TLS Version' Expression = '$PROT' } @{ Name = 'Autoscale Min Capacity' Expression = '$MinCap' } @{ Name = 'Autoscale Max Capacity' Expression = '$MaxCap' } @{ Name = 'SKU Name' Expression = '$data.sku.tier' } @{ Name = 'Current Instances' Expression = '$data.sku.capacity' } @{ Name = 'Backend Pool State' Expression = '$BackendState' } @{ Name = 'Backend' Expression = '[string]$data.backendAddressPools.name' } @{ Name = 'Frontend' Expression = '[string]$data.frontendIPConfigurations.name' } @{ Name = 'Frontend Ports' Expression = '[string]$data.frontendports.properties.port' } @{ Name = 'Gateways' Expression = '[string]$data.gatewayIPConfigurations.name' } @{ Name = 'HTTP Listeners' Expression = '[string]$data.httpListeners.name' } @{ Name = 'Request Routing Rules' Expression = '[string]$data.RequestRoutingRules.Name' } @{ Name = 'Resource U' Expression = '$ResUCount' } @{ Name = 'Tag Name' Expression = '[string]$Tag.Name' } @{ Name = 'Tag Value' Expression = '[string]$Tag.Value' } ) Export = @{ WorksheetName = 'App Gateway' TableNamePrefix = 'APPGWTb_' Columns = @( 'Subscription' 'Resource Group' 'Name' 'Location' 'SKU Name' 'Retiring Feature' 'Retiring Date' 'State' 'WAF Enabled' 'Minimum TLS Version' 'Autoscale Min Capacity' 'Autoscale Max Capacity' 'Current Instances' 'Backend Pool State' 'Backend' 'Frontend' 'Frontend Ports' 'Gateways' 'HTTP Listeners' 'Request Routing Rules' 'Resource U' ) TagColumns = @( 'Tag Name' 'Tag Value' ) TagColumnsBefore = 'Resource U' NumberFormat = '0' ConditionalText = @( 'New-ConditionalText FALSE -Range I:I' 'New-ConditionalText ''Default'' -Range J:J' 'New-ConditionalText ''1.0'' -Range J:J' 'New-ConditionalText ''1.1'' -Range J:J' 'New-ConditionalText ''Autoscale Disabled'' -Range K:K' 'New-ConditionalText ''Autoscale Disabled'' -Range L:L' 'New-ConditionalText ''Empty'' -Range N:N' 'New-ConditionalText -Range F2:F100 -ConditionalType ContainsText' ) } SourceCollector = 'Modules/Public/InventoryModules/Networking/ApplicationGateways.ps1' } |