Class: AWSCDK::RDS::DatabaseProxyEndpointOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
rds/database_proxy_endpoint_options.rb

Overview

Options for a new DatabaseProxyEndpoint.

Direct Known Subclasses

DatabaseProxyEndpointProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vpc:, db_proxy_endpoint_name: nil, security_groups: nil, target_role: nil, vpc_subnets: nil) ⇒ DatabaseProxyEndpointOptions

Returns a new instance of DatabaseProxyEndpointOptions.

Parameters:

  • vpc (AWSCDK::EC2::IVPC)

    The VPC of the DB proxy endpoint.

  • db_proxy_endpoint_name (String, nil) (defaults to: nil)

    The name of the DB proxy endpoint.

  • security_groups (Array<AWSCDK::EC2::ISecurityGroup>, nil) (defaults to: nil)

    The VPC security groups to associate with the new proxy endpoint.

  • target_role (AWSCDK::RDS::ProxyEndpointTargetRole, nil) (defaults to: nil)

    A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    The subnets of DB proxy endpoint.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'rds/database_proxy_endpoint_options.rb', line 12

def initialize(vpc:, db_proxy_endpoint_name: nil, security_groups: nil, target_role: nil, vpc_subnets: nil)
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @db_proxy_endpoint_name = db_proxy_endpoint_name
  Jsii::Type.check_type(@db_proxy_endpoint_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dbProxyEndpointName") unless @db_proxy_endpoint_name.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @target_role = target_role
  Jsii::Type.check_type(@target_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLlByb3h5RW5kcG9pbnRUYXJnZXRSb2xlIn0=")), "targetRole") unless @target_role.nil?
  @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets
  Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil?
end

Instance Attribute Details

#db_proxy_endpoint_nameString? (readonly)

Note:

Default: - a CDK generated name

The name of the DB proxy endpoint.

Returns:

  • (String, nil)


33
34
35
# File 'rds/database_proxy_endpoint_options.rb', line 33

def db_proxy_endpoint_name
  @db_proxy_endpoint_name
end

#security_groupsArray<AWSCDK::EC2::ISecurityGroup>? (readonly)

Note:

Default: - Default security group for the VPC

The VPC security groups to associate with the new proxy endpoint.

Returns:



38
39
40
# File 'rds/database_proxy_endpoint_options.rb', line 38

def security_groups
  @security_groups
end

#target_roleAWSCDK::RDS::ProxyEndpointTargetRole? (readonly)

Note:

Default: - ProxyEndpointTargetRole.READ_WRITE

A value that indicates whether the DB proxy endpoint can be used for read/write or read-only operations.



43
44
45
# File 'rds/database_proxy_endpoint_options.rb', line 43

def target_role
  @target_role
end

#vpcAWSCDK::EC2::IVPC (readonly)

The VPC of the DB proxy endpoint.

Returns:



28
29
30
# File 'rds/database_proxy_endpoint_options.rb', line 28

def vpc
  @vpc
end

#vpc_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - the VPC default strategy if not specified.

The subnets of DB proxy endpoint.



48
49
50
# File 'rds/database_proxy_endpoint_options.rb', line 48

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



50
51
52
53
54
55
56
57
58
# File 'rds/database_proxy_endpoint_options.rb', line 50

def self.jsii_properties
  {
    :vpc => "vpc",
    :db_proxy_endpoint_name => "dbProxyEndpointName",
    :security_groups => "securityGroups",
    :target_role => "targetRole",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
# File 'rds/database_proxy_endpoint_options.rb', line 60

def to_jsii
  result = {}
  result.merge!({
    "vpc" => @vpc,
    "dbProxyEndpointName" => @db_proxy_endpoint_name,
    "securityGroups" => @security_groups,
    "targetRole" => @target_role,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end