Skip to content

EC2 VPC Block Public Access settings should block internet gateway traffic

This control checks whether Amazon EC2 VPC Block Public Access (BPA) settings are configured to block internet gateway traffic for all Amazon VPCs in the AWS account. The control fails if VPC BPA settings aren't configured to block internet gateway traffic. For the control to pass, the VPC BPA InternetGatewayBlockMode must be set to block-bidirectional or block-ingress. If the parameter vpcBpaInternetGatewayBlockMode is provided, the control passes only if the VPC BPA value for InternetGatewayBlockMode matches the parameter.

How to fix

Attribute internet_gateway_block_mode of aws_vpc_block_public_access_options must be one of: "block-bidirectional", "block-ingress".

Implementation options

Choose the option that matches how you manage Terraform. All options satisfy this control.

Option 1: Terraform AWS provider resources

If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_vpc_block_public_access_options.

resource "aws_vpc_block_public_access_options" "this" {
  internet_gateway_block_mode = "block-bidirectional"
}
Which option should I choose?
  • Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
  • Open source module (terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready.
  • Terraform AWS provider resources: manage Terraform resources directly.

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf (CTF) Control: vpc_block_public_access_restrict_internet_gateway_traffic

  • Powerpipe Control: aws_compliance.control.vpc_block_public_access_restrict_internet_gateway_traffic