Control: Amazon Elasticsearch Service domains should be in a VPC
Description
This control checks whether Amazon Elasticsearch Service domains are in a VPC. It does not evaluate the VPC subnet routing configuration to determine public access. You should ensure that Amazon Elasticsearch domains are not attached to public subnets.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.es_domain_in_vpcSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.es_domain_in_vpc --shareSQL
This control uses a named query:
select  address as resource,  case    when (attributes_std -> 'vpc_options' -> 'subnet_ids') is not null then 'ok'    else 'alarm'  end status,  split_part(address, '.', 2) || case    when (attributes_std -> 'vpc_options' -> 'subnet_ids') is not null then ' in VPC'    else ' not in VPC'  end || '.' reason    , path || ':' || start_linefrom  terraform_resourcewhere  type = 'aws_elasticsearch_domain';