Class: AWSCDK::EC2::NatProvider
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EC2::NatProvider
- Defined in:
- ec2/nat_provider.rb
Overview
NAT providers.
Determines what type of NAT provider to create, either NAT gateways or NAT instance.
Direct Known Subclasses
NatGatewayProvider, NatInstanceProvider, NatInstanceProviderV2
Class Method Summary collapse
-
.gateway(props = nil) ⇒ AWSCDK::EC2::NatProvider
Use NAT Gateways to provide NAT services for your VPC.
-
.instance(props) ⇒ AWSCDK::EC2::NatInstanceProvider
deprecated
Deprecated.
use instanceV2. 'instance' is deprecated since NatInstanceProvider uses a instance image that has reached EOL on Dec 31 2023
-
.instance_v2(props) ⇒ AWSCDK::EC2::NatInstanceProviderV2
Use NAT instances to provide NAT services for your VPC.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#configure_nat(options) ⇒ void
Called by the VPC to configure NAT.
-
#configure_subnet(subnet) ⇒ void
Configures subnet with the gateway.
-
#configured_gateways ⇒ Array<AWSCDK::EC2::GatewayConfig>
Return list of gateways spawned by the provider.
-
#initialize ⇒ NatProvider
constructor
A new instance of NatProvider.
Constructor Details
#initialize ⇒ NatProvider
Returns a new instance of NatProvider.
11 12 13 |
# File 'ec2/nat_provider.rb', line 11 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
.gateway(props = nil) ⇒ AWSCDK::EC2::NatProvider
Use NAT Gateways to provide NAT services for your VPC.
NAT gateways are managed by AWS.
30 31 32 33 34 |
# File 'ec2/nat_provider.rb', line 30 def self.gateway(props = nil) props = props.is_a?(Hash) ? ::AWSCDK::EC2::NatGatewayProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLk5hdEdhdGV3YXlQcm9wcyJ9")), "props") unless props.nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.NatProvider", "gateway", [props]) end |
.instance(props) ⇒ AWSCDK::EC2::NatInstanceProvider
use instanceV2. 'instance' is deprecated since NatInstanceProvider uses a instance image that has reached EOL on Dec 31 2023
Use NAT instances to provide NAT services for your VPC.
NAT instances are managed by you, but in return allow more configuration.
Be aware that instances created using this provider will not be automatically replaced if they are stopped for any reason. You should implement your own NatProvider based on AutoScaling groups if you need that.
48 49 50 51 52 |
# File 'ec2/nat_provider.rb', line 48 def self.instance(props) props = props.is_a?(Hash) ? ::AWSCDK::EC2::NatInstanceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLk5hdEluc3RhbmNlUHJvcHMifQ==")), "props") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.NatProvider", "instance", [props]) end |
.instance_v2(props) ⇒ AWSCDK::EC2::NatInstanceProviderV2
Use NAT instances to provide NAT services for your VPC.
NAT instances are managed by you, but in return allow more configuration.
Be aware that instances created using this provider will not be automatically replaced if they are stopped for any reason. You should implement your own NatProvider based on AutoScaling groups if you need that.
65 66 67 68 69 |
# File 'ec2/nat_provider.rb', line 65 def self.instance_v2(props) props = props.is_a?(Hash) ? ::AWSCDK::EC2::NatInstanceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLk5hdEluc3RhbmNlUHJvcHMifQ==")), "props") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.NatProvider", "instanceV2", [props]) end |
.jsii_overridable_methods ⇒ Object
15 16 17 18 19 20 21 |
# File 'ec2/nat_provider.rb', line 15 def self.jsii_overridable_methods { :configured_gateways => { kind: :property, name: "configuredGateways", is_optional: false }, :configure_nat => { kind: :method, name: "configureNat", is_optional: false }, :configure_subnet => { kind: :method, name: "configureSubnet", is_optional: false }, } end |
Instance Method Details
#configure_nat(options) ⇒ void
This method returns an undefined value.
Called by the VPC to configure NAT.
Don't call this directly, the VPC will call it automatically.
84 85 86 87 88 |
# File 'ec2/nat_provider.rb', line 84 def configure_nat() = .is_a?(Hash) ? ::AWSCDK::EC2::ConfigureNatOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkNvbmZpZ3VyZU5hdE9wdGlvbnMifQ==")), "options") jsii_call_method("configureNat", []) end |
#configure_subnet(subnet) ⇒ void
This method returns an undefined value.
Configures subnet with the gateway.
Don't call this directly, the VPC will call it automatically.
96 97 98 99 |
# File 'ec2/nat_provider.rb', line 96 def configure_subnet(subnet) Jsii::Type.check_type(subnet, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlByaXZhdGVTdWJuZXQifQ==")), "subnet") jsii_call_method("configureSubnet", [subnet]) end |
#configured_gateways ⇒ Array<AWSCDK::EC2::GatewayConfig>
Return list of gateways spawned by the provider.
74 75 76 |
# File 'ec2/nat_provider.rb', line 74 def configured_gateways() jsii_get_property("configuredGateways") end |