Class VpcLookupOptions.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.VpcLookupOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<VpcLookupOptions>
- Enclosing interface:
VpcLookupOptions
@Stability(Stable)
public static final class VpcLookupOptions.Builder
extends Object
implements software.amazon.jsii.Builder<VpcLookupOptions>
A builder for
VpcLookupOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofVpcLookupOptions.getIsDefault()
ownerAccountId
(String ownerAccountId) Sets the value ofVpcLookupOptions.getOwnerAccountId()
Sets the value ofVpcLookupOptions.getRegion()
returnVpnGateways
(Boolean returnVpnGateways) Sets the value ofVpcLookupOptions.getReturnVpnGateways()
subnetGroupNameTag
(String subnetGroupNameTag) Sets the value ofVpcLookupOptions.getSubnetGroupNameTag()
Sets the value ofVpcLookupOptions.getTags()
Sets the value ofVpcLookupOptions.getVpcId()
Sets the value ofVpcLookupOptions.getVpcName()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
isDefault
Sets the value ofVpcLookupOptions.getIsDefault()
- Parameters:
isDefault
- Whether to match the default VPC.- Returns:
this
-
ownerAccountId
Sets the value ofVpcLookupOptions.getOwnerAccountId()
- Parameters:
ownerAccountId
- The ID of the AWS account that owns the VPC.- Returns:
this
-
region
Sets the value ofVpcLookupOptions.getRegion()
- Parameters:
region
- Optional to override inferred region.- Returns:
this
-
returnVpnGateways
Sets the value ofVpcLookupOptions.getReturnVpnGateways()
- Parameters:
returnVpnGateways
- Whether to look up whether a VPN Gateway is attached to the looked up VPC. You can set this tofalse
if you know the VPC does not have a VPN Gateway attached, in order to avoid an API call.If you change this property from
false
totrue
or undefined, you may need to clear the corresponding context entry incdk.context.json
in order to trigger a new lookup.- Returns:
this
-
subnetGroupNameTag
Sets the value ofVpcLookupOptions.getSubnetGroupNameTag()
- Parameters:
subnetGroupNameTag
- Optional tag for subnet group name. If not provided, we'll look at the aws-cdk:subnet-name tag. If the subnet does not have the specified tag, we'll use its type as the name.- Returns:
this
-
tags
Sets the value ofVpcLookupOptions.getTags()
- Parameters:
tags
- Tags on the VPC. The VPC must have all of these tags- Returns:
this
-
vpcId
Sets the value ofVpcLookupOptions.getVpcId()
- Parameters:
vpcId
- The ID of the VPC. If given, will import exactly this VPC.- Returns:
this
-
vpcName
Sets the value ofVpcLookupOptions.getVpcName()
- Parameters:
vpcName
- The name of the VPC. If given, will import the VPC with this name.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<VpcLookupOptions>
- Returns:
- a new instance of
VpcLookupOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-