Class: AWSCDK::RDS::SubnetGroupProps

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

Overview

Properties for creating a SubnetGroup.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description:, vpc:, removal_policy: nil, subnet_group_name: nil, vpc_subnets: nil) ⇒ SubnetGroupProps

Returns a new instance of SubnetGroupProps.

Parameters:

  • description (String)

    Description of the subnet group.

  • vpc (AWSCDK::EC2::IVPC)

    The VPC to place the subnet group in.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    The removal policy to apply when the subnet group are removed from the stack or replaced during an update.

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

    The name of the subnet group.

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

    Which subnets within the VPC to associate with this group.



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

def initialize(description:, vpc:, removal_policy: nil, subnet_group_name: nil, vpc_subnets: nil)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description")
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
  @subnet_group_name = subnet_group_name
  Jsii::Type.check_type(@subnet_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetGroupName") unless @subnet_group_name.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

#descriptionString (readonly)

Description of the subnet group.

Returns:

  • (String)


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

def description
  @description
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.DESTROY

The removal policy to apply when the subnet group are removed from the stack or replaced during an update.

Returns:



37
38
39
# File 'rds/subnet_group_props.rb', line 37

def removal_policy
  @removal_policy
end

#subnet_group_nameString? (readonly)

Note:

Default: - a name is generated

The name of the subnet group.

Returns:

  • (String, nil)


42
43
44
# File 'rds/subnet_group_props.rb', line 42

def subnet_group_name
  @subnet_group_name
end

#vpcAWSCDK::EC2::IVPC (readonly)

The VPC to place the subnet group in.

Returns:



32
33
34
# File 'rds/subnet_group_props.rb', line 32

def vpc
  @vpc
end

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

Note:

Default: - private subnets

Which subnets within the VPC to associate with this group.



47
48
49
# File 'rds/subnet_group_props.rb', line 47

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



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

def self.jsii_properties
  {
    :description => "description",
    :vpc => "vpc",
    :removal_policy => "removalPolicy",
    :subnet_group_name => "subnetGroupName",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!({
    "description" => @description,
    "vpc" => @vpc,
    "removalPolicy" => @removal_policy,
    "subnetGroupName" => @subnet_group_name,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end