Skip to content

Commit

Permalink
fix: Updated macro lambda_vpc_multi_az_check (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronsh12 authored Nov 5, 2024
1 parent fe147aa commit 7e96c60
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions transformations/aws/macros/lambda/lambda_vpc_multi_az_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SELECT
'{{framework}}' AS framework,
'{{check_id}}' AS check_id,
'VPC Lambda functions should operate in more than one Availability Zone' AS title,
account_id,
l.account_id,
l.arn AS resource_id,
CASE
WHEN COUNT(DISTINCT s.availability_zone_id) > 1 THEN 'pass'
Expand All @@ -22,15 +22,15 @@ INNER JOIN
LEFT JOIN
aws_ec2_subnets AS s ON a.value::text = s.subnet_id
GROUP BY
l.arn, account_id
l.arn, l.account_id
{% endmacro %}

{% macro snowflake__lambda_vpc_multi_az_check(framework, check_id) %}
select
'{{framework}}' As framework,
'{{check_id}}' As check_id,
'VPC Lambda functions should operate in more than one Availability Zone' AS title,
account_id,
l.account_id,
l.arn AS resource_id,
CASE WHEN
count (distinct s.availability_zone_id) > 1 THEN 'pass'
Expand All @@ -44,15 +44,15 @@ LEFT JOIN
aws_ec2_subnets s
ON
a.value = s.subnet_id
group by l.arn, account_id
group by l.arn, l.account_id
{% endmacro %}

{% macro bigquery__lambda_vpc_multi_az_check(framework, check_id) %}
select
'foundational_security' As framework,
'lambda.5' As check_id,
'VPC Lambda functions should operate in more than one Availability Zone' AS title,
account_id,
l.account_id,
l.arn AS resource_id,
CASE WHEN
count (distinct s.availability_zone_id) > 1 THEN 'pass'
Expand All @@ -65,15 +65,15 @@ LEFT JOIN
{{ full_table_name("aws_ec2_subnets") }} s
ON
JSON_VALUE(a.value) = s.subnet_id
group by l.arn, account_id
group by l.arn, l.account_id
{% endmacro %}

{% macro athena__lambda_vpc_multi_az_check(framework, check_id) %}
select
'{{framework}}' As framework,
'{{check_id}}' As check_id,
'VPC Lambda functions should operate in more than one Availability Zone' AS title,
account_id,
l.account_id,
l.arn AS resource_id,
CASE WHEN
count (distinct s.availability_zone_id) > 1 THEN 'pass'
Expand All @@ -85,5 +85,5 @@ LEFT JOIN
aws_ec2_subnets s
ON
json_extract_scalar(l.configuration, '$.VpcConfig.SubnetIds') = s.subnet_id
group by l.arn, account_id
group by l.arn, l.account_id
{% endmacro %}

0 comments on commit 7e96c60

Please sign in to comment.