Control: Ensure Cloudwatch Lambda insights is enabled
Description
Ensure that Amazon CloudWatch Lambda Insights is enabled for your Amazon Lambda functions for enhanced monitoring.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.lambda_function_cloudwatch_insights_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.lambda_function_cloudwatch_insights_enabled --share
SQL
This control uses a named query:
select arn as resource, case when exists ( select 1 from jsonb_array_elements(layers) as l where l ->> 'Arn' like '%:layer:LambdaInsightsExtension:%' ) then 'ok' else 'alarm' end as status, case when exists ( select 1 from jsonb_array_elements(layers) as l where l ->> 'Arn' like '%:layer:LambdaInsightsExtension:%' ) then title || ' CloudWatch Insights enabled.' else title || ' CloudWatch Insights disabled.' end as reason , region, account_idfrom aws_lambda_function;