turbot/steampipe-mod-terraform-aws-compliance

Control: EFS access point should have a root directory

Description

This control checks whether the Elastic File System access point has a root directory associated with it.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.efs_access_point_has_root_directory

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.efs_access_point_has_root_directory --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'root_directory') is null then 'alarm'
when (attributes_std -> 'root_directory' -> 'path') is not null then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'root_directory') is null then ' ''root_directory'' is not defined'
when (attributes_std -> 'root_directory' -> 'path') is not null then ' has root directory'
else ' does not have root directory'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_efs_access_point';

Tags