turbot/guardrails_insights

Query: resources_by_workspace

Usage

powerpipe query guardrails_insights.query.resources_by_workspace

Steampipe Tables

SQL

select
_ctx ->> 'connection_name' as "Connection Name",
sum((output -> 'accounts' -> 'metadata' -> 'stats' ->> 'total')::int) as "Resources"
from
guardrails_query
where
query = '{
accounts: resources(
filter: "resourceTypeId:tmod:@turbot/aws#/resource/types/aws,tmod:@turbot/azure#/resource/types/azure,tmod:@turbot/gcp#/resource/types/gcp,tmod:@turbot/servicenow#/resource/types/serviceNow,tmod:@turbot/turbot#/resource/types/folder,tmod:@turbot/turbot#/resource/types/file,tmod:@turbot/turbot#/resource/types/smartFolder"
) {
metadata {
stats {
total
}
}
}
}'
group by
_ctx ->> 'connection_name';

Dashboards

The query is used in the dashboards: