Class: AWSCDK::DynamoDB::ReplicaTableProps

Inherits:
TableOptionsV2
  • Object
show all
Defined in:
dynamo_db/replica_table_props.rb

Overview

Properties used to configure a replica table.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contributor_insights: nil, contributor_insights_specification: nil, deletion_protection: nil, kinesis_stream: nil, point_in_time_recovery: nil, point_in_time_recovery_specification: nil, resource_policy: nil, stream_resource_policy: nil, table_class: nil, tags: nil, region:, global_secondary_index_options: nil, max_read_request_units: nil, read_capacity: nil) ⇒ ReplicaTableProps

Returns a new instance of ReplicaTableProps.

Parameters:

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

    Whether CloudWatch contributor insights is enabled.

  • contributor_insights_specification (AWSCDK::DynamoDB::ContributorInsightsSpecification, nil) (defaults to: nil)

    Whether CloudWatch contributor insights is enabled and what mode is selected.

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

    Whether deletion protection is enabled.

  • kinesis_stream (AWSCDK::Kinesis::IStream, nil) (defaults to: nil)

    Kinesis Data Stream to capture item level changes.

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

    Whether point-in-time recovery is enabled.

  • point_in_time_recovery_specification (AWSCDK::DynamoDB::PointInTimeRecoverySpecification, nil) (defaults to: nil)

    Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.

  • resource_policy (AWSCDK::IAM::PolicyDocument, nil) (defaults to: nil)

    Resource policy to assign to DynamoDB Table.

  • stream_resource_policy (AWSCDK::IAM::PolicyDocument, nil) (defaults to: nil)

    Resource policy to assign to DynamoDB Stream.

  • table_class (AWSCDK::DynamoDB::TableClass, nil) (defaults to: nil)

    The table class.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    Tags to be applied to the primary table (default replica table).

  • region (String)

    The region that the replica table will be created in.

  • global_secondary_index_options (Hash{String => AWSCDK::DynamoDB::ReplicaGlobalSecondaryIndexOptions}, nil) (defaults to: nil)

    Options used to configure global secondary index properties.

  • max_read_request_units (Numeric, nil) (defaults to: nil)

    The maximum read request units.

  • read_capacity (AWSCDK::DynamoDB::Capacity, nil) (defaults to: nil)

    The read capacity.



21
22
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
# File 'dynamo_db/replica_table_props.rb', line 21

def initialize(contributor_insights: nil, contributor_insights_specification: nil, deletion_protection: nil, kinesis_stream: nil, point_in_time_recovery: nil, point_in_time_recovery_specification: nil, resource_policy: nil, stream_resource_policy: nil, table_class: nil, tags: nil, region:, global_secondary_index_options: nil, max_read_request_units: nil, read_capacity: nil)
  @contributor_insights = contributor_insights
  Jsii::Type.check_type(@contributor_insights, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "contributorInsights") unless @contributor_insights.nil?
  @contributor_insights_specification = contributor_insights_specification.is_a?(Hash) ? ::AWSCDK::DynamoDB::ContributorInsightsSpecification.new(**contributor_insights_specification.transform_keys(&:to_sym)) : contributor_insights_specification
  Jsii::Type.check_type(@contributor_insights_specification, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQ29udHJpYnV0b3JJbnNpZ2h0c1NwZWNpZmljYXRpb24ifQ==")), "contributorInsightsSpecification") unless @contributor_insights_specification.nil?
  @deletion_protection = deletion_protection
  Jsii::Type.check_type(@deletion_protection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deletionProtection") unless @deletion_protection.nil?
  @kinesis_stream = kinesis_stream
  Jsii::Type.check_type(@kinesis_stream, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa2luZXNpcy5JU3RyZWFtIn0=")), "kinesisStream") unless @kinesis_stream.nil?
  @point_in_time_recovery = point_in_time_recovery
  Jsii::Type.check_type(@point_in_time_recovery, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "pointInTimeRecovery") unless @point_in_time_recovery.nil?
  @point_in_time_recovery_specification = point_in_time_recovery_specification.is_a?(Hash) ? ::AWSCDK::DynamoDB::PointInTimeRecoverySpecification.new(**point_in_time_recovery_specification.transform_keys(&:to_sym)) : point_in_time_recovery_specification
  Jsii::Type.check_type(@point_in_time_recovery_specification, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuUG9pbnRJblRpbWVSZWNvdmVyeVNwZWNpZmljYXRpb24ifQ==")), "pointInTimeRecoverySpecification") unless @point_in_time_recovery_specification.nil?
  @resource_policy = resource_policy
  Jsii::Type.check_type(@resource_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeURvY3VtZW50In0=")), "resourcePolicy") unless @resource_policy.nil?
  @stream_resource_policy = stream_resource_policy
  Jsii::Type.check_type(@stream_resource_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlBvbGljeURvY3VtZW50In0=")), "streamResourcePolicy") unless @stream_resource_policy.nil?
  @table_class = table_class
  Jsii::Type.check_type(@table_class, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuVGFibGVDbGFzcyJ9")), "tableClass") unless @table_class.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @region = region
  Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region")
  @global_secondary_index_options = global_secondary_index_options.is_a?(Hash) ? global_secondary_index_options.transform_values { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::DynamoDB::ReplicaGlobalSecondaryIndexOptions.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : global_secondary_index_options
  Jsii::Type.check_type(@global_secondary_index_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5SZXBsaWNhR2xvYmFsU2Vjb25kYXJ5SW5kZXhPcHRpb25zIn0sImtpbmQiOiJtYXAifX0=")), "globalSecondaryIndexOptions") unless @global_secondary_index_options.nil?
  @max_read_request_units = max_read_request_units
  Jsii::Type.check_type(@max_read_request_units, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxReadRequestUnits") unless @max_read_request_units.nil?
  @read_capacity = read_capacity
  Jsii::Type.check_type(@read_capacity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQ2FwYWNpdHkifQ==")), "readCapacity") unless @read_capacity.nil?
end

Instance Attribute Details

#contributor_insightsBoolean? (readonly)

Deprecated.

use contributorInsightsSpecification instead

Note:

Default: false

Whether CloudWatch contributor insights is enabled.

Returns:

  • (Boolean, nil)


57
58
59
# File 'dynamo_db/replica_table_props.rb', line 57

def contributor_insights
  @contributor_insights
end

#contributor_insights_specificationAWSCDK::DynamoDB::ContributorInsightsSpecification? (readonly)

Note:

Default: - contributor insights is not enabled

Whether CloudWatch contributor insights is enabled and what mode is selected.



62
63
64
# File 'dynamo_db/replica_table_props.rb', line 62

def contributor_insights_specification
  @contributor_insights_specification
end

#deletion_protectionBoolean? (readonly)

Note:

Default: false

Whether deletion protection is enabled.

Returns:

  • (Boolean, nil)


67
68
69
# File 'dynamo_db/replica_table_props.rb', line 67

def deletion_protection
  @deletion_protection
end

#global_secondary_index_optionsHash{String => AWSCDK::DynamoDB::ReplicaGlobalSecondaryIndexOptions}? (readonly)

Note:

Default: - inherited from the primary table

Options used to configure global secondary index properties.



114
115
116
# File 'dynamo_db/replica_table_props.rb', line 114

def global_secondary_index_options
  @global_secondary_index_options
end

#kinesis_streamAWSCDK::Kinesis::IStream? (readonly)

Note:

Default: - no Kinesis Data Stream

Kinesis Data Stream to capture item level changes.

Returns:



72
73
74
# File 'dynamo_db/replica_table_props.rb', line 72

def kinesis_stream
  @kinesis_stream
end

#max_read_request_unitsNumeric? (readonly)

Note:

Default: - inherited from the primary table

The maximum read request units.

Note: This can only be configured if the primary table billing is PAY_PER_REQUEST.

Returns:

  • (Numeric, nil)


121
122
123
# File 'dynamo_db/replica_table_props.rb', line 121

def max_read_request_units
  @max_read_request_units
end

#point_in_time_recoveryBoolean? (readonly)

Deprecated.

use pointInTimeRecoverySpecification instead

Note:

Default: false - point in time recovery is not enabled.

Whether point-in-time recovery is enabled.

Returns:

  • (Boolean, nil)


78
79
80
# File 'dynamo_db/replica_table_props.rb', line 78

def point_in_time_recovery
  @point_in_time_recovery
end

#point_in_time_recovery_specificationAWSCDK::DynamoDB::PointInTimeRecoverySpecification? (readonly)

Note:

Default: - point in time recovery is not enabled.

Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.



83
84
85
# File 'dynamo_db/replica_table_props.rb', line 83

def point_in_time_recovery_specification
  @point_in_time_recovery_specification
end

#read_capacityAWSCDK::DynamoDB::Capacity? (readonly)

Note:

Default: - inherited from the primary table

The read capacity.

Note: This can only be configured if the primary table billing is provisioned.

Returns:



128
129
130
# File 'dynamo_db/replica_table_props.rb', line 128

def read_capacity
  @read_capacity
end

#regionString (readonly)

The region that the replica table will be created in.

Returns:

  • (String)


109
110
111
# File 'dynamo_db/replica_table_props.rb', line 109

def region
  @region
end

#resource_policyAWSCDK::IAM::PolicyDocument? (readonly)

Note:

Default: - No resource policy statements are added to the created table.

Resource policy to assign to DynamoDB Table.



89
90
91
# File 'dynamo_db/replica_table_props.rb', line 89

def resource_policy
  @resource_policy
end

#stream_resource_policyAWSCDK::IAM::PolicyDocument? (readonly)

Note:

Default: - No resource policy statements are added to the stream.

Resource policy to assign to DynamoDB Stream.



95
96
97
# File 'dynamo_db/replica_table_props.rb', line 95

def stream_resource_policy
  @stream_resource_policy
end

#table_classAWSCDK::DynamoDB::TableClass? (readonly)

Note:

Default: TableClass.STANDARD

The table class.



100
101
102
# File 'dynamo_db/replica_table_props.rb', line 100

def table_class
  @table_class
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

Note:

Default: - no tags

Tags to be applied to the primary table (default replica table).

Returns:



105
106
107
# File 'dynamo_db/replica_table_props.rb', line 105

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'dynamo_db/replica_table_props.rb', line 130

def self.jsii_properties
  {
    :contributor_insights => "contributorInsights",
    :contributor_insights_specification => "contributorInsightsSpecification",
    :deletion_protection => "deletionProtection",
    :kinesis_stream => "kinesisStream",
    :point_in_time_recovery => "pointInTimeRecovery",
    :point_in_time_recovery_specification => "pointInTimeRecoverySpecification",
    :resource_policy => "resourcePolicy",
    :stream_resource_policy => "streamResourcePolicy",
    :table_class => "tableClass",
    :tags => "tags",
    :region => "region",
    :global_secondary_index_options => "globalSecondaryIndexOptions",
    :max_read_request_units => "maxReadRequestUnits",
    :read_capacity => "readCapacity",
  }
end

Instance Method Details

#to_jsiiObject



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'dynamo_db/replica_table_props.rb', line 149

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "contributorInsights" => @contributor_insights,
    "contributorInsightsSpecification" => @contributor_insights_specification,
    "deletionProtection" => @deletion_protection,
    "kinesisStream" => @kinesis_stream,
    "pointInTimeRecovery" => @point_in_time_recovery,
    "pointInTimeRecoverySpecification" => @point_in_time_recovery_specification,
    "resourcePolicy" => @resource_policy,
    "streamResourcePolicy" => @stream_resource_policy,
    "tableClass" => @table_class,
    "tags" => @tags,
    "region" => @region,
    "globalSecondaryIndexOptions" => @global_secondary_index_options,
    "maxReadRequestUnits" => @max_read_request_units,
    "readCapacity" => @read_capacity,
  })
  result.compact
end