turbot/aws_well_architected

Query: wellarchitected_workload_answered_question_count

Usage

powerpipe query aws_well_architected.query.wellarchitected_workload_answered_question_count

SQL

with question_counts as (
select
sum((risk_counts ->> 'UNANSWERED')::int) as unanswered_questions,
sum((risk_counts ->> 'HIGH')::int) + sum((risk_counts ->> 'MEDIUM')::int) + sum((risk_counts ->> 'NONE')::int) + sum((risk_counts ->> 'NOT_APPLICABLE')::int) as answered_questions
from
aws_wellarchitected_lens_review as r
where
r.workload_id = $1
and r.lens_arn = any(string_to_array($2, ','))
)
select
'Answered Questions' as label,
answered_questions || '/' || unanswered_questions + answered_questions || ' (' || (100 * answered_questions/(unanswered_questions + answered_questions))::numeric || '%)' as value,
case
when unanswered_questions = 0 then 'ok'
else 'alert'
end as type
from
question_counts

Params

ArgsNameDefaultDescriptionVariable
$1workload_id
    $2lens_arn

      Dashboards

      The query is used in the dashboards: