AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::VPCBlockPublicAccessExclusion

CfnVPCBlockPublicAccessExclusion

Create a VPC Block Public Access (BPA) exclusion. A VPC BPA exclusion is a mode that can be applied to a single VPC or subnet that exempts it from the account’s BPA mode and will allow bidirectional or egress-only access. You can create BPA exclusions for VPCs and subnets even when BPA is not enabled on the account to ensure that there is no traffic disruption to the exclusions when VPC BPA is turned on. To learn more about VPC BPA, see [Block public access to VPCs and subnets](https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html) in the *Amazon VPC User Guide* .

Import

import { CfnVPCBlockPublicAccessExclusion } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnVPCBlockPublicAccessExclusion

Properties

Configuration passed to the constructor as CfnVPCBlockPublicAccessExclusionProps.

internetGatewayExclusionModeRequired
string

The desired VPC Block Public Access mode for a specific VPC or subnet exclusion. - `allow-bidirectional` : Allow all internet traffic to and from the excluded VPCs and subnets. - `allow-egress` : Allow outbound internet traffic from the excluded VPCs and subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only applies when VPC Block Public Access is set to `block-bidirectional` .

subnetIdOptional
string

The ID of the subnet you want to exclude. Required only if you don't specify VpcId.

tagsOptional
CfnTag[]

An array of key-value pairs to apply to this resource.

vpcIdOptional
string

The ID of the VPC you want to exclude. Required only if you don't specify SubnetId.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic