Module: AWSCDK::EC2::IVPC

Includes:
IResource, Interfaces::AWSEC2::IVPCRef
Included in:
VPC
Defined in:
ec2/ivpc.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'ec2/ivpc.rb', line 221

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :vpc_ref => { kind: :property, name: "vpcRef", is_optional: false },
    :availability_zones => { kind: :property, name: "availabilityZones", is_optional: false },
    :internet_connectivity_established => { kind: :property, name: "internetConnectivityEstablished", is_optional: false },
    :isolated_subnets => { kind: :property, name: "isolatedSubnets", is_optional: false },
    :private_subnets => { kind: :property, name: "privateSubnets", is_optional: false },
    :public_subnets => { kind: :property, name: "publicSubnets", is_optional: false },
    :vpc_arn => { kind: :property, name: "vpcArn", is_optional: false },
    :vpc_cidr_block => { kind: :property, name: "vpcCidrBlock", is_optional: false },
    :vpc_id => { kind: :property, name: "vpcId", is_optional: false },
    :vpn_gateway_id => { kind: :property, name: "vpnGatewayId", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :add_client_vpn_endpoint => { kind: :method, name: "addClientVpnEndpoint", is_optional: false },
    :add_flow_log => { kind: :method, name: "addFlowLog", is_optional: false },
    :add_gateway_endpoint => { kind: :method, name: "addGatewayEndpoint", is_optional: false },
    :add_interface_endpoint => { kind: :method, name: "addInterfaceEndpoint", is_optional: false },
    :add_vpn_connection => { kind: :method, name: "addVpnConnection", is_optional: false },
    :enable_vpn_gateway => { kind: :method, name: "enableVpnGateway", is_optional: false },
    :select_subnets => { kind: :method, name: "selectSubnets", is_optional: false },
  }
end

Instance Method Details

#add_client_vpn_endpoint(id, options) ⇒ AWSCDK::EC2::ClientVpnEndpoint

Adds a new client VPN endpoint to this VPC.

Parameters:

Returns:



143
144
145
146
147
148
# File 'ec2/ivpc.rb', line 143

def add_client_vpn_endpoint(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::ClientVpnEndpointOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNsaWVudFZwbkVuZHBvaW50T3B0aW9ucyJ9")), "options")
  jsii_call_method("addClientVpnEndpoint", [id, options])
end

#add_flow_log(id, options = nil) ⇒ AWSCDK::EC2::FlowLog

Adds a new Flow Log to this VPC.

Parameters:

Returns:



155
156
157
158
159
160
# File 'ec2/ivpc.rb', line 155

def add_flow_log(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::FlowLogOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkZsb3dMb2dPcHRpb25zIn0=")), "options") unless options.nil?
  jsii_call_method("addFlowLog", [id, options])
end

#add_gateway_endpoint(id, options) ⇒ AWSCDK::EC2::GatewayVPCEndpoint

Adds a new gateway endpoint to this VPC.

Parameters:

Returns:



167
168
169
170
171
172
# File 'ec2/ivpc.rb', line 167

def add_gateway_endpoint(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::GatewayVPCEndpointOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkdhdGV3YXlWcGNFbmRwb2ludE9wdGlvbnMifQ==")), "options")
  jsii_call_method("addGatewayEndpoint", [id, options])
end

#add_interface_endpoint(id, options) ⇒ AWSCDK::EC2::InterfaceVPCEndpoint

Adds a new interface endpoint to this VPC.



179
180
181
182
183
184
# File 'ec2/ivpc.rb', line 179

def add_interface_endpoint(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::InterfaceVPCEndpointOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkludGVyZmFjZVZwY0VuZHBvaW50T3B0aW9ucyJ9")), "options")
  jsii_call_method("addInterfaceEndpoint", [id, options])
end

#add_vpn_connection(id, options) ⇒ AWSCDK::EC2::VpnConnection

Adds a new VPN connection to this VPC.

Parameters:

Returns:



191
192
193
194
195
196
# File 'ec2/ivpc.rb', line 191

def add_vpn_connection(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::VpnConnectionOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlZwbkNvbm5lY3Rpb25PcHRpb25zIn0=")), "options")
  jsii_call_method("addVpnConnection", [id, options])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



133
134
135
136
# File 'ec2/ivpc.rb', line 133

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#availability_zonesArray<String>

AZs for this VPC.

Returns:

  • (Array<String>)


47
48
49
# File 'ec2/ivpc.rb', line 47

def availability_zones()
  jsii_get_property("availabilityZones")
end

#enable_vpn_gateway(options) ⇒ void

This method returns an undefined value.

Adds a VPN Gateway to this VPC.

Parameters:



202
203
204
205
206
# File 'ec2/ivpc.rb', line 202

def enable_vpn_gateway(options)
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::EnableVpnGatewayOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkVuYWJsZVZwbkdhdGV3YXlPcHRpb25zIn0=")), "options")
  jsii_call_method("enableVpnGateway", [options])
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



26
27
28
# File 'ec2/ivpc.rb', line 26

def env()
  jsii_get_property("env")
end

#internet_connectivity_establishedConstructs::IDependable

Dependable that can be depended upon to force internet connectivity established on the VPC.

Returns:

  • (Constructs::IDependable)


54
55
56
# File 'ec2/ivpc.rb', line 54

def internet_connectivity_established()
  jsii_get_property("internetConnectivityEstablished")
end

#isolated_subnetsArray<AWSCDK::EC2::ISubnet>

List of isolated subnets in this VPC.

Returns:



61
62
63
# File 'ec2/ivpc.rb', line 61

def isolated_subnets()
  jsii_get_property("isolatedSubnets")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


11
12
13
# File 'ec2/ivpc.rb', line 11

def node()
  jsii_get_property("node")
end

#private_subnetsArray<AWSCDK::EC2::ISubnet>

List of private subnets in this VPC.

Returns:



68
69
70
# File 'ec2/ivpc.rb', line 68

def private_subnets()
  jsii_get_property("privateSubnets")
end

#public_subnetsArray<AWSCDK::EC2::ISubnet>

List of public subnets in this VPC.

Returns:



75
76
77
# File 'ec2/ivpc.rb', line 75

def public_subnets()
  jsii_get_property("publicSubnets")
end

#select_subnets(selection = nil) ⇒ AWSCDK::EC2::SelectedSubnets

Return information on the subnets appropriate for the given selection strategy.

Requires that at least one subnet is matched, throws a descriptive error message otherwise.

Parameters:

Returns:



215
216
217
218
219
# File 'ec2/ivpc.rb', line 215

def select_subnets(selection = nil)
  selection = selection.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**selection.transform_keys(&:to_sym)) : selection
  Jsii::Type.check_type(selection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "selection") unless selection.nil?
  jsii_call_method("selectSubnets", [selection])
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



33
34
35
# File 'ec2/ivpc.rb', line 33

def stack()
  jsii_get_property("stack")
end

#vpc_arnString

ARN for this VPC.

Returns:

  • (String)


82
83
84
# File 'ec2/ivpc.rb', line 82

def vpc_arn()
  jsii_get_property("vpcArn")
end

#vpc_cidr_blockString

CIDR range for this VPC.

Returns:

  • (String)


89
90
91
# File 'ec2/ivpc.rb', line 89

def vpc_cidr_block()
  jsii_get_property("vpcCidrBlock")
end

#vpc_idString

Identifier for this VPC.

Returns:

  • (String)


96
97
98
# File 'ec2/ivpc.rb', line 96

def vpc_id()
  jsii_get_property("vpcId")
end

#vpc_refAWSCDK::Interfaces::AWSEC2::VPCReference

A reference to a VPC resource.



40
41
42
# File 'ec2/ivpc.rb', line 40

def vpc_ref()
  jsii_get_property("vpcRef")
end

#vpn_gateway_idString?

Identifier for the VPN gateway.

Returns:

  • (String, nil)


103
104
105
# File 'ec2/ivpc.rb', line 103

def vpn_gateway_id()
  jsii_get_property("vpnGatewayId")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



114
115
116
117
118
119
# File 'ec2/ivpc.rb', line 114

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end