Class: AWSCDK::RDS::ServerlessClusterProps

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

Overview

Properties for a new Aurora Serverless v1 Cluster.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(engine:, backup_retention: nil, cluster_identifier: nil, copy_tags_to_snapshot: nil, credentials: nil, default_database_name: nil, deletion_protection: nil, enable_data_api: nil, parameter_group: nil, removal_policy: nil, scaling: nil, security_groups: nil, storage_encryption_key: nil, subnet_group: nil, vpc: nil, vpc_subnets: nil) ⇒ ServerlessClusterProps

Returns a new instance of ServerlessClusterProps.

Parameters:

  • engine (AWSCDK::RDS::IClusterEngine)

    What kind of database to start.

  • backup_retention (AWSCDK::Duration, nil) (defaults to: nil)

    The number of days during which automatic DB snapshots are retained.

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

    An optional identifier for the cluster.

  • copy_tags_to_snapshot (Boolean, nil) (defaults to: nil)

    Whether to copy tags to the snapshot when a snapshot is created.

  • credentials (AWSCDK::RDS::Credentials, nil) (defaults to: nil)

    Credentials for the administrative user.

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

    Name of a database which is automatically created inside the cluster.

  • deletion_protection (Boolean, nil) (defaults to: nil)

    Indicates whether the DB cluster should have deletion protection enabled.

  • enable_data_api (Boolean, nil) (defaults to: nil)

    Whether to enable the Data API.

  • parameter_group (AWSCDK::RDS::IParameterGroup, nil) (defaults to: nil)

    Additional parameters to pass to the database engine.

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

    The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.

  • scaling (AWSCDK::RDS::ServerlessScalingOptions, nil) (defaults to: nil)

    Scaling configuration of an Aurora Serverless database cluster.

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

    Security group.

  • storage_encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The KMS key for storage encryption.

  • subnet_group (AWSCDK::Interfaces::AWSRDS::IDBSubnetGroupRef, nil) (defaults to: nil)

    Existing subnet group for the cluster.

  • vpc (AWSCDK::EC2::IVPC, nil) (defaults to: nil)

    The VPC that this Aurora Serverless v1 Cluster has been created in.

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

    Where to place the instances within the VPC.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'rds/serverless_cluster_props.rb', line 23

def initialize(engine:, backup_retention: nil, cluster_identifier: nil, copy_tags_to_snapshot: nil, credentials: nil, default_database_name: nil, deletion_protection: nil, enable_data_api: nil, parameter_group: nil, removal_policy: nil, scaling: nil, security_groups: nil, storage_encryption_key: nil, subnet_group: nil, vpc: nil, vpc_subnets: nil)
  @engine = engine
  Jsii::Type.check_type(@engine, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLklDbHVzdGVyRW5naW5lIn0=")), "engine")
  @backup_retention = backup_retention
  Jsii::Type.check_type(@backup_retention, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "backupRetention") unless @backup_retention.nil?
  @cluster_identifier = cluster_identifier
  Jsii::Type.check_type(@cluster_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clusterIdentifier") unless @cluster_identifier.nil?
  @copy_tags_to_snapshot = copy_tags_to_snapshot
  Jsii::Type.check_type(@copy_tags_to_snapshot, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "copyTagsToSnapshot") unless @copy_tags_to_snapshot.nil?
  @credentials = credentials
  Jsii::Type.check_type(@credentials, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLkNyZWRlbnRpYWxzIn0=")), "credentials") unless @credentials.nil?
  @default_database_name = default_database_name
  Jsii::Type.check_type(@default_database_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultDatabaseName") unless @default_database_name.nil?
  @deletion_protection = deletion_protection
  Jsii::Type.check_type(@deletion_protection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deletionProtection") unless @deletion_protection.nil?
  @enable_data_api = enable_data_api
  Jsii::Type.check_type(@enable_data_api, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableDataApi") unless @enable_data_api.nil?
  @parameter_group = parameter_group
  Jsii::Type.check_type(@parameter_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLklQYXJhbWV0ZXJHcm91cCJ9")), "parameterGroup") unless @parameter_group.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
  @scaling = scaling.is_a?(Hash) ? ::AWSCDK::RDS::ServerlessScalingOptions.new(**scaling.transform_keys(&:to_sym)) : scaling
  Jsii::Type.check_type(@scaling, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLlNlcnZlcmxlc3NTY2FsaW5nT3B0aW9ucyJ9")), "scaling") unless @scaling.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @storage_encryption_key = storage_encryption_key
  Jsii::Type.check_type(@storage_encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "storageEncryptionKey") unless @storage_encryption_key.nil?
  @subnet_group = subnet_group
  Jsii::Type.check_type(@subnet_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19yZHMuSURCU3VibmV0R3JvdXBSZWYifQ==")), "subnetGroup") unless @subnet_group.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.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

#backup_retentionAWSCDK::Duration? (readonly)

Note:

Default: Duration.days(1)

The number of days during which automatic DB snapshots are retained.

Automatic backup retention cannot be disabled on serverless clusters. Must be a value from 1 day to 35 days.

Returns:



69
70
71
# File 'rds/serverless_cluster_props.rb', line 69

def backup_retention
  @backup_retention
end

#cluster_identifierString? (readonly)

Note:

Default: - A name is automatically generated.

An optional identifier for the cluster.

Returns:

  • (String, nil)


74
75
76
# File 'rds/serverless_cluster_props.rb', line 74

def cluster_identifier
  @cluster_identifier
end

#copy_tags_to_snapshotBoolean? (readonly)

Note:

Default: - true

Whether to copy tags to the snapshot when a snapshot is created.

Returns:

  • (Boolean, nil)


79
80
81
# File 'rds/serverless_cluster_props.rb', line 79

def copy_tags_to_snapshot
  @copy_tags_to_snapshot
end

#credentialsAWSCDK::RDS::Credentials? (readonly)

Note:

Default: - A username of 'admin' and SecretsManager-generated password

Credentials for the administrative user.

Returns:



84
85
86
# File 'rds/serverless_cluster_props.rb', line 84

def credentials
  @credentials
end

#default_database_nameString? (readonly)

Note:

Default: - Database is not created in cluster.

Name of a database which is automatically created inside the cluster.

Returns:

  • (String, nil)


89
90
91
# File 'rds/serverless_cluster_props.rb', line 89

def default_database_name
  @default_database_name
end

#deletion_protectionBoolean? (readonly)

Note:

Default: - true if removalPolicy is RETAIN, false otherwise

Indicates whether the DB cluster should have deletion protection enabled.

Returns:

  • (Boolean, nil)


94
95
96
# File 'rds/serverless_cluster_props.rb', line 94

def deletion_protection
  @deletion_protection
end

#enable_data_apiBoolean? (readonly)

Note:

Default: false

Whether to enable the Data API.



100
101
102
# File 'rds/serverless_cluster_props.rb', line 100

def enable_data_api
  @enable_data_api
end

#engineAWSCDK::RDS::IClusterEngine (readonly)

What kind of database to start.



61
62
63
# File 'rds/serverless_cluster_props.rb', line 61

def engine
  @engine
end

#parameter_groupAWSCDK::RDS::IParameterGroup? (readonly)

Note:

Default: - no parameter group.

Additional parameters to pass to the database engine.



105
106
107
# File 'rds/serverless_cluster_props.rb', line 105

def parameter_group
  @parameter_group
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: - RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)

The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.

Returns:



110
111
112
# File 'rds/serverless_cluster_props.rb', line 110

def removal_policy
  @removal_policy
end

#scalingAWSCDK::RDS::ServerlessScalingOptions? (readonly)

Note:

Default: - Serverless cluster is automatically paused after 5 minutes of being idle. minimum capacity: 2 ACU maximum capacity: 16 ACU

Scaling configuration of an Aurora Serverless database cluster.



115
116
117
# File 'rds/serverless_cluster_props.rb', line 115

def scaling
  @scaling
end

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

Note:

Default: - a new security group is created if vpc was provided. If the vpc property was not provided, no VPC security groups will be associated with the DB cluster.

Security group.

Returns:



120
121
122
# File 'rds/serverless_cluster_props.rb', line 120

def security_groups
  @security_groups
end

#storage_encryption_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - the default master key will be used for storage encryption

The KMS key for storage encryption.

Returns:



125
126
127
# File 'rds/serverless_cluster_props.rb', line 125

def storage_encryption_key
  @storage_encryption_key
end

#subnet_groupAWSCDK::Interfaces::AWSRDS::IDBSubnetGroupRef? (readonly)

Note:

Default: - a new subnet group is created if vpc was provided. If the vpc property was not provided, no subnet group will be associated with the DB cluster

Existing subnet group for the cluster.



130
131
132
# File 'rds/serverless_cluster_props.rb', line 130

def subnet_group
  @subnet_group
end

#vpcAWSCDK::EC2::IVPC? (readonly)

Note:

Default: - the default VPC in the account and region will be used

The VPC that this Aurora Serverless v1 Cluster has been created in.

Returns:



135
136
137
# File 'rds/serverless_cluster_props.rb', line 135

def vpc
  @vpc
end

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

Note:

Default: - the VPC default strategy if not specified.

Where to place the instances within the VPC.

If provided, the vpc property must also be specified.



142
143
144
# File 'rds/serverless_cluster_props.rb', line 142

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'rds/serverless_cluster_props.rb', line 144

def self.jsii_properties
  {
    :engine => "engine",
    :backup_retention => "backupRetention",
    :cluster_identifier => "clusterIdentifier",
    :copy_tags_to_snapshot => "copyTagsToSnapshot",
    :credentials => "credentials",
    :default_database_name => "defaultDatabaseName",
    :deletion_protection => "deletionProtection",
    :enable_data_api => "enableDataApi",
    :parameter_group => "parameterGroup",
    :removal_policy => "removalPolicy",
    :scaling => "scaling",
    :security_groups => "securityGroups",
    :storage_encryption_key => "storageEncryptionKey",
    :subnet_group => "subnetGroup",
    :vpc => "vpc",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'rds/serverless_cluster_props.rb', line 165

def to_jsii
  result = {}
  result.merge!({
    "engine" => @engine,
    "backupRetention" => @backup_retention,
    "clusterIdentifier" => @cluster_identifier,
    "copyTagsToSnapshot" => @copy_tags_to_snapshot,
    "credentials" => @credentials,
    "defaultDatabaseName" => @default_database_name,
    "deletionProtection" => @deletion_protection,
    "enableDataApi" => @enable_data_api,
    "parameterGroup" => @parameter_group,
    "removalPolicy" => @removal_policy,
    "scaling" => @scaling,
    "securityGroups" => @security_groups,
    "storageEncryptionKey" => @storage_encryption_key,
    "subnetGroup" => @subnet_group,
    "vpc" => @vpc,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end