| Modifier and Type | Method and Description |
|---|---|
Vpc.Builder |
availabilityZones(List<String> availabilityZones)
Availability zones this VPC spans.
|
Vpc |
build() |
Vpc.Builder |
cidr(String cidr)
The CIDR range to use for the VPC, e.g.
|
static Vpc.Builder |
create(software.constructs.Construct scope,
String id) |
Vpc.Builder |
defaultInstanceTenancy(DefaultInstanceTenancy defaultInstanceTenancy)
The default tenancy of instances launched into the VPC.
|
Vpc.Builder |
enableDnsHostnames(Boolean enableDnsHostnames)
Indicates whether the instances launched in the VPC get public DNS hostnames.
|
Vpc.Builder |
enableDnsSupport(Boolean enableDnsSupport)
Indicates whether the DNS resolution is supported for the VPC.
|
Vpc.Builder |
flowLogs(Map<String,? extends FlowLogOptions> flowLogs)
Flow logs to add to this VPC.
|
Vpc.Builder |
gatewayEndpoints(Map<String,? extends GatewayVpcEndpointOptions> gatewayEndpoints)
Gateway endpoints to add to this VPC.
|
Vpc.Builder |
maxAzs(Number maxAzs)
Define the maximum number of AZs to use in this region.
|
Vpc.Builder |
natGatewayProvider(NatProvider natGatewayProvider)
What type of NAT provider to use.
|
Vpc.Builder |
natGateways(Number natGateways)
The number of NAT Gateways/Instances to create.
|
Vpc.Builder |
natGatewaySubnets(SubnetSelection natGatewaySubnets)
Configures the subnets which will have NAT Gateways/Instances.
|
Vpc.Builder |
subnetConfiguration(List<? extends SubnetConfiguration> subnetConfiguration)
Configure the subnets to build for each AZ.
|
Vpc.Builder |
vpcName(String vpcName)
The VPC name.
|
Vpc.Builder |
vpnConnections(Map<String,? extends VpnConnectionOptions> vpnConnections)
VPN connections to this VPC.
|
Vpc.Builder |
vpnGateway(Boolean vpnGateway)
Indicates whether a VPN gateway should be created and attached to this VPC.
|
Vpc.Builder |
vpnGatewayAsn(Number vpnGatewayAsn)
The private Autonomous System Number (ASN) for the VPN gateway.
|
Vpc.Builder |
vpnRoutePropagation(List<? extends SubnetSelection> vpnRoutePropagation)
Where to propagate VPN routes.
|
@Stability(value=Stable) public static Vpc.Builder create(software.constructs.Construct scope, String id)
scope - This parameter is required.id - This parameter is required.Vpc.Builder.@Stability(value=Stable) public Vpc.Builder availabilityZones(List<String> availabilityZones)
Specify this option only if you do not specify maxAzs.
Default: - a subset of AZs of the stack
availabilityZones - Availability zones this VPC spans. This parameter is required.this@Stability(value=Stable) public Vpc.Builder cidr(String cidr)
Should be a minimum of /28 and maximum size of /16. The range will be split across all subnets per Availability Zone.
Default: Vpc.DEFAULT_CIDR_RANGE
cidr - The CIDR range to use for the VPC, e.g. '10.0.0.0/16'. This parameter is required.this@Stability(value=Stable) public Vpc.Builder defaultInstanceTenancy(DefaultInstanceTenancy defaultInstanceTenancy)
By setting this to dedicated tenancy, instances will be launched on hardware dedicated to a single AWS customer, unless specifically specified at instance launch time. Please note, not all instance types are usable with Dedicated tenancy.
Default: DefaultInstanceTenancy.Default (shared) tenancy
defaultInstanceTenancy - The default tenancy of instances launched into the VPC. This parameter is required.this@Stability(value=Stable) public Vpc.Builder enableDnsHostnames(Boolean enableDnsHostnames)
If this attribute is true, instances in the VPC get public DNS hostnames, but only if the enableDnsSupport attribute is also set to true.
Default: true
enableDnsHostnames - Indicates whether the instances launched in the VPC get public DNS hostnames. This parameter is required.this@Stability(value=Stable) public Vpc.Builder enableDnsSupport(Boolean enableDnsSupport)
If this attribute is false, the Amazon-provided DNS server in the VPC that resolves public DNS hostnames to IP addresses is not enabled. If this attribute is true, 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 IPv4 network range plus two will succeed.
Default: true
enableDnsSupport - Indicates whether the DNS resolution is supported for the VPC. This parameter is required.this@Stability(value=Stable) public Vpc.Builder flowLogs(Map<String,? extends FlowLogOptions> flowLogs)
Default: - No flow logs.
flowLogs - Flow logs to add to this VPC. This parameter is required.this@Stability(value=Stable) public Vpc.Builder gatewayEndpoints(Map<String,? extends GatewayVpcEndpointOptions> gatewayEndpoints)
Default: - None.
gatewayEndpoints - Gateway endpoints to add to this VPC. This parameter is required.this@Stability(value=Stable) public Vpc.Builder maxAzs(Number maxAzs)
If the region has more AZs than you want to use (for example, because of EIP limits), pick a lower number here. The AZs will be sorted and picked from the start of the list.
If you pick a higher number than the number of AZs in the region, all AZs in the region will be selected. To use "all AZs" available to your account, use a high number (such as 99).
Be aware that environment-agnostic stacks will be created with access to only 2 AZs, so to use more than 2 AZs, be sure to specify the account and region on your stack.
Specify this option only if you do not specify availabilityZones.
Default: 3
maxAzs - Define the maximum number of AZs to use in this region. This parameter is required.this@Stability(value=Stable) public Vpc.Builder natGatewayProvider(NatProvider natGatewayProvider)
Select between NAT gateways or NAT instances. NAT gateways may not be available in all AWS regions.
Default: NatProvider.gateway()
natGatewayProvider - What type of NAT provider to use. This parameter is required.this@Stability(value=Stable) public Vpc.Builder natGateways(Number natGateways)
The type of NAT gateway or instance will be determined by the
natGatewayProvider parameter.
You can set this number lower than the number of Availability Zones in your VPC in order to save on NAT cost. Be aware you may be charged for cross-AZ data traffic instead.
Default: - One NAT gateway/instance per Availability Zone
natGateways - The number of NAT Gateways/Instances to create. This parameter is required.this@Stability(value=Stable) public Vpc.Builder natGatewaySubnets(SubnetSelection natGatewaySubnets)
You can pick a specific group of subnets by specifying the group name; the picked subnets must be public subnets.
Only necessary if you have more than one public subnet group.
Default: - All public subnets.
natGatewaySubnets - Configures the subnets which will have NAT Gateways/Instances. This parameter is required.this@Stability(value=Stable) public Vpc.Builder subnetConfiguration(List<? extends SubnetConfiguration> subnetConfiguration)
Each entry in this list configures a Subnet Group; each group will contain a subnet for each Availability Zone.
For example, if you want 1 public subnet, 1 private subnet, and 1 isolated subnet in each AZ provide the following:
// Example automatically generated from non-compiling source. May contain errors.
Vpc.Builder.create(this, "VPC")
.subnetConfiguration(List.of(SubnetConfiguration.builder()
.cidrMask(24)
.name("ingress")
.subnetType(SubnetType.PUBLIC)
.build(), SubnetConfiguration.builder()
.cidrMask(24)
.name("application")
.subnetType(SubnetType.PRIVATE_WITH_EGRESS)
.build(), SubnetConfiguration.builder()
.cidrMask(28)
.name("rds")
.subnetType(SubnetType.PRIVATE_ISOLATED)
.build()))
.build();
Default: - The VPC CIDR will be evenly divided between 1 public and 1 private subnet per AZ.
subnetConfiguration - Configure the subnets to build for each AZ. This parameter is required.this@Stability(value=Stable) public Vpc.Builder vpcName(String vpcName)
Since the VPC resource doesn't support providing a physical name, the value provided here will be recorded in the Name tag
Default: this.node.path
vpcName - The VPC name. This parameter is required.this@Stability(value=Stable) public Vpc.Builder vpnConnections(Map<String,? extends VpnConnectionOptions> vpnConnections)
Default: - No connections.
vpnConnections - VPN connections to this VPC. This parameter is required.this@Stability(value=Stable) public Vpc.Builder vpnGateway(Boolean vpnGateway)
Default: - true when vpnGatewayAsn or vpnConnections is specified
vpnGateway - Indicates whether a VPN gateway should be created and attached to this VPC. This parameter is required.this@Stability(value=Stable) public Vpc.Builder vpnGatewayAsn(Number vpnGatewayAsn)
Default: - Amazon default ASN.
vpnGatewayAsn - The private Autonomous System Number (ASN) for the VPN gateway. This parameter is required.this@Stability(value=Stable) public Vpc.Builder vpnRoutePropagation(List<? extends SubnetSelection> vpnRoutePropagation)
Default: - On the route tables associated with private subnets. If no private subnets exists, isolated subnets are used. If no isolated subnets exists, public subnets are used.
vpnRoutePropagation - Where to propagate VPN routes. This parameter is required.thisCopyright © 2022. All rights reserved.