Control: Elasticsearch Service domains should be in a VPC
Description
This control checks whether Elasticsearch domains are in a VPC. It does not evaluate the VPC subnet routing configuration to determine public access. You should ensure that Amazon ES domains are not attached to public subnets.
Usage
Run the control in your terminal:
powerpipe control run aws_perimeter.control.es_domain_in_vpcSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_perimeter.control.es_domain_in_vpc --shareSteampipe Tables
SQL
select  arn as resource,  case    when vpc_options ->> 'VPCId' is null then 'alarm'    else 'ok'  end status,  case    when vpc_options ->> 'VPCId' is null then title || ' not in VPC.'    else title || ' in VPC ' || (vpc_options ->> 'VPCId') || '.'  end reason    , region, account_idfrom  aws_elasticsearch_domain;