Class: AWSCDK::EC2::VPCLookupOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::VPCLookupOptions
- Defined in:
- ec2/vpc_lookup_options.rb
Overview
Properties for looking up an existing VPC.
The combination of properties must specify filter down to exactly one non-default VPC, otherwise an error is raised.
Instance Attribute Summary collapse
-
#is_default ⇒ Boolean?
readonly
Whether to match the default VPC.
-
#owner_account_id ⇒ String?
readonly
The ID of the AWS account that owns the VPC.
-
#region ⇒ String?
readonly
Optional to override inferred region.
-
#return_vpn_gateways ⇒ Boolean?
readonly
Whether to look up whether a VPN Gateway is attached to the looked up VPC.
-
#subnet_group_name_tag ⇒ String?
readonly
Optional tag for subnet group name.
-
#tags ⇒ Hash{String => String}?
readonly
Tags on the VPC.
-
#vpc_id ⇒ String?
readonly
The ID of the VPC.
-
#vpc_name ⇒ String?
readonly
The name of the VPC.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(is_default: nil, owner_account_id: nil, region: nil, return_vpn_gateways: nil, subnet_group_name_tag: nil, tags: nil, vpc_id: nil, vpc_name: nil) ⇒ VPCLookupOptions
constructor
A new instance of VPCLookupOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(is_default: nil, owner_account_id: nil, region: nil, return_vpn_gateways: nil, subnet_group_name_tag: nil, tags: nil, vpc_id: nil, vpc_name: nil) ⇒ VPCLookupOptions
Returns a new instance of VPCLookupOptions.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'ec2/vpc_lookup_options.rb', line 18 def initialize(is_default: nil, owner_account_id: nil, region: nil, return_vpn_gateways: nil, subnet_group_name_tag: nil, tags: nil, vpc_id: nil, vpc_name: nil) @is_default = is_default Jsii::Type.check_type(@is_default, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "isDefault") unless @is_default.nil? @owner_account_id = owner_account_id Jsii::Type.check_type(@owner_account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ownerAccountId") unless @owner_account_id.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @return_vpn_gateways = return_vpn_gateways Jsii::Type.check_type(@return_vpn_gateways, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "returnVpnGateways") unless @return_vpn_gateways.nil? @subnet_group_name_tag = subnet_group_name_tag Jsii::Type.check_type(@subnet_group_name_tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetGroupNameTag") unless @subnet_group_name_tag.nil? @tags = Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil? @vpc_id = vpc_id Jsii::Type.check_type(@vpc_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "vpcId") unless @vpc_id.nil? @vpc_name = vpc_name Jsii::Type.check_type(@vpc_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "vpcName") unless @vpc_name.nil? end |
Instance Attribute Details
#is_default ⇒ Boolean? (readonly)
Default: Don't care whether we return the default VPC
Whether to match the default VPC.
41 42 43 |
# File 'ec2/vpc_lookup_options.rb', line 41 def is_default @is_default end |
#owner_account_id ⇒ String? (readonly)
Default: the account id of the parent stack
The ID of the AWS account that owns the VPC.
46 47 48 |
# File 'ec2/vpc_lookup_options.rb', line 46 def owner_account_id @owner_account_id end |
#region ⇒ String? (readonly)
Default: Current stack's environment region
Optional to override inferred region.
51 52 53 |
# File 'ec2/vpc_lookup_options.rb', line 51 def region @region end |
#return_vpn_gateways ⇒ Boolean? (readonly)
Default: true
Whether to look up whether a VPN Gateway is attached to the looked up VPC.
You can set this to false 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 to true or undefined, you may
need to clear the corresponding context entry in cdk.context.json in
order to trigger a new lookup.
63 64 65 |
# File 'ec2/vpc_lookup_options.rb', line 63 def return_vpn_gateways @return_vpn_gateways end |
#subnet_group_name_tag ⇒ String? (readonly)
Default: aws-cdk:subnet-name
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.
72 73 74 |
# File 'ec2/vpc_lookup_options.rb', line 72 def subnet_group_name_tag @subnet_group_name_tag end |
#tags ⇒ Hash{String => String}? (readonly)
Default: Don't filter on tags
Tags on the VPC.
The VPC must have all of these tags
79 80 81 |
# File 'ec2/vpc_lookup_options.rb', line 79 def @tags end |
#vpc_id ⇒ String? (readonly)
Default: Don't filter on vpcId
The ID of the VPC.
If given, will import exactly this VPC.
86 87 88 |
# File 'ec2/vpc_lookup_options.rb', line 86 def vpc_id @vpc_id end |
#vpc_name ⇒ String? (readonly)
Default: Don't filter on vpcName
The name of the VPC.
If given, will import the VPC with this name.
93 94 95 |
# File 'ec2/vpc_lookup_options.rb', line 93 def vpc_name @vpc_name end |
Class Method Details
.jsii_properties ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'ec2/vpc_lookup_options.rb', line 95 def self.jsii_properties { :is_default => "isDefault", :owner_account_id => "ownerAccountId", :region => "region", :return_vpn_gateways => "returnVpnGateways", :subnet_group_name_tag => "subnetGroupNameTag", :tags => "tags", :vpc_id => "vpcId", :vpc_name => "vpcName", } end |
Instance Method Details
#to_jsii ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'ec2/vpc_lookup_options.rb', line 108 def to_jsii result = {} result.merge!({ "isDefault" => @is_default, "ownerAccountId" => @owner_account_id, "region" => @region, "returnVpnGateways" => @return_vpn_gateways, "subnetGroupNameTag" => @subnet_group_name_tag, "tags" => @tags, "vpcId" => @vpc_id, "vpcName" => @vpc_name, }) result.compact end |