Class: AWSCDK::EC2::GatewayVPCEndpointOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/gateway_vpc_endpoint_options.rb

Overview

Options to add a gateway endpoint to a VPC.

Direct Known Subclasses

GatewayVPCEndpointProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service:, subnets: nil) ⇒ GatewayVPCEndpointOptions

Returns a new instance of GatewayVPCEndpointOptions.

Parameters:



9
10
11
12
13
14
# File 'ec2/gateway_vpc_endpoint_options.rb', line 9

def initialize(service:, subnets: nil)
  @service = service
  Jsii::Type.check_type(@service, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklHYXRld2F5VnBjRW5kcG9pbnRTZXJ2aWNlIn0=")), "service")
  @subnets = subnets.is_a?(Array) ? subnets.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : subnets
  Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuU3VibmV0U2VsZWN0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "subnets") unless @subnets.nil?
end

Instance Attribute Details

#serviceAWSCDK::EC2::IGatewayVPCEndpointService (readonly)

The service to use for this gateway VPC endpoint.



19
20
21
# File 'ec2/gateway_vpc_endpoint_options.rb', line 19

def service
  @service
end

#subnetsArray<AWSCDK::EC2::SubnetSelection>? (readonly)

Note:

Default: - All subnets in the VPC

Where to add endpoint routing.

By default, this endpoint will be routable from all subnets in the VPC. Specify a list of subnet selection objects here to be more specific.

Examples:

vpc = nil # AWSCDK::EC2::VPC

vpc.add_gateway_endpoint("DynamoDbEndpoint", {
    service: AWSCDK::EC2::GatewayVPCEndpointAWSService.DYNAMODB,
    # Add only to ISOLATED subnets
    subnets: [
        {subnet_type: AWSCDK::EC2::SubnetType::PRIVATE_ISOLATED},
    ],
})

Returns:



38
39
40
# File 'ec2/gateway_vpc_endpoint_options.rb', line 38

def subnets
  @subnets
end

Class Method Details

.jsii_propertiesObject



40
41
42
43
44
45
# File 'ec2/gateway_vpc_endpoint_options.rb', line 40

def self.jsii_properties
  {
    :service => "service",
    :subnets => "subnets",
  }
end

Instance Method Details

#to_jsiiObject



47
48
49
50
51
52
53
54
# File 'ec2/gateway_vpc_endpoint_options.rb', line 47

def to_jsii
  result = {}
  result.merge!({
    "service" => @service,
    "subnets" => @subnets,
  })
  result.compact
end