CfnVPCProps Struct
Properties for defining a CfnVPC.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnVPCProps: ec2.CfnVPCProps = {
cidrBlock: 'cidrBlock',
enableDnsHostnames: false,
enableDnsSupport: false,
instanceTenancy: 'instanceTenancy',
ipv4IpamPoolId: 'ipv4IpamPoolId',
ipv4NetmaskLength: 123,
tags: [{
key: 'key',
value: 'value',
}],
vpcEncryptionControl: {
egressOnlyInternetGatewayExclusion: 'egressOnlyInternetGatewayExclusion',
elasticFileSystemExclusion: 'elasticFileSystemExclusion',
internetGatewayExclusion: 'internetGatewayExclusion',
lambdaExclusion: 'lambdaExclusion',
mode: 'mode',
natGatewayExclusion: 'natGatewayExclusion',
resourceExclusions: {
egressOnlyInternetGateway: {
state: 'state',
stateMessage: 'stateMessage',
},
elasticFileSystem: {
state: 'state',
stateMessage: 'stateMessage',
},
internetGateway: {
state: 'state',
stateMessage: 'stateMessage',
},
lambda: {
state: 'state',
stateMessage: 'stateMessage',
},
natGateway: {
state: 'state',
stateMessage: 'stateMessage',
},
virtualPrivateGateway: {
state: 'state',
stateMessage: 'stateMessage',
},
vpcLattice: {
state: 'state',
stateMessage: 'stateMessage',
},
vpcPeering: {
state: 'state',
stateMessage: 'stateMessage',
},
},
state: 'state',
stateMessage: 'stateMessage',
virtualPrivateGatewayExclusion: 'virtualPrivateGatewayExclusion',
vpcEncryptionControlId: 'vpcEncryptionControlId',
vpcId: 'vpcId',
vpcLatticeExclusion: 'vpcLatticeExclusion',
vpcPeeringExclusion: 'vpcPeeringExclusion',
},
};
Properties
For example, 10.0.0.0/16 . We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18 , we modify it to 100.68.0.0/18 .
You must specify either CidrBlock or Ipv4IpamPoolId .
enableDnsHostnamesboolean | IResolvableenable_dns_hostnamestyping.Union[bool, IResolvable]enableDnsHostnamesBooleanEnableDnsHostnamesboolEnableDnsHostnamesinterface{}#notes
If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
enableDnsSupportboolean | IResolvableenable_dns_supporttyping.Union[bool, IResolvable]enableDnsSupportBooleanEnableDnsSupportboolEnableDnsSupportinterface{}#notes
If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC .
instanceTenancystringinstance_tenancystrinstanceTenancyStringInstanceTenancystringInstanceTenancy*string#notes
default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy ofhostduring instance launch. You cannot specify a tenancy ofdefaultduring instance launch.
Updating InstanceTenancy requires no replacement only if you are updating its value from dedicated to default . Updating InstanceTenancy from default to dedicated requires replacement.
ipv4IpamPoolIdstringipv4_ipam_pool_idstripv4IpamPoolIdStringIpv4IpamPoolIdstringIpv4IpamPoolId*string#For more information, see What is IPAM? in the Amazon VPC IPAM User Guide .
You must specify either CidrBlock or Ipv4IpamPoolId .
ipv4NetmaskLengthnumberipv4_netmask_lengthint | floatipv4NetmaskLengthNumberIpv4NetmaskLengthdoubleIpv4NetmaskLength*float64#For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide .
vpcEncryptionControlIResolvable | CfnVPC.VpcEncryptionControlPropertyvpc_encryption_controltyping.Union[IResolvable, VpcEncryptionControlProperty]vpcEncryptionControlIResolvableVpcEncryptionControlIResolvableVpcEncryptionControlinterface{}#For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.