turbot/aws_well_architected

Query: wellarchitected_workload_milestone_risk_counts

Usage

powerpipe query aws_well_architected.query.wellarchitected_workload_milestone_risk_counts

SQL

-- Get current risk counts
select
workload_id,
workload_name,
'latest' as milestone_name,
101 as milestone_number, -- 100 milestone max for workloads
updated_at as recorded_at,
risk_counts
from
aws_wellarchitected_workload
union
-- Get past milestone risk counts
select
workload_id,
workload ->> 'WorkloadName' as workload_name,
milestone_name,
milestone_number,
recorded_at,
workload -> 'RiskCounts' as risk_counts
from
aws_wellarchitected_milestone
order by
workload_id,
milestone_number