Class: AWSCDK::DynamoDB::CfnTable::StreamSpecificationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::DynamoDB::CfnTable::StreamSpecificationProperty
- Defined in:
- dynamo_db/cfn_table.rb
Overview
Represents the DynamoDB Streams configuration for a table in DynamoDB.
Instance Attribute Summary collapse
-
#resource_policy ⇒ AWSCDK::IResolvable, ...
readonly
Creates or updates a resource-based policy document that contains the permissions for DynamoDB resources, such as a table's streams.
-
#stream_view_type ⇒ String
readonly
When an item in the table is modified,
StreamViewTypedetermines what information is written to the stream for this table.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stream_view_type:, resource_policy: nil) ⇒ StreamSpecificationProperty
constructor
A new instance of StreamSpecificationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(stream_view_type:, resource_policy: nil) ⇒ StreamSpecificationProperty
Returns a new instance of StreamSpecificationProperty.
1699 1700 1701 1702 1703 1704 |
# File 'dynamo_db/cfn_table.rb', line 1699 def initialize(stream_view_type:, resource_policy: nil) @stream_view_type = stream_view_type Jsii::Type.check_type(@stream_view_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "streamViewType") @resource_policy = resource_policy.is_a?(Hash) ? ::AWSCDK::DynamoDB::CfnTable::ResourcePolicyProperty.new(**resource_policy.transform_keys(&:to_sym)) : resource_policy Jsii::Type.check_type(@resource_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19keW5hbW9kYi5DZm5UYWJsZS5SZXNvdXJjZVBvbGljeVByb3BlcnR5In1dfX0=")), "resourcePolicy") unless @resource_policy.nil? end |
Instance Attribute Details
#resource_policy ⇒ AWSCDK::IResolvable, ... (readonly)
Creates or updates a resource-based policy document that contains the permissions for DynamoDB resources, such as a table's streams.
Resource-based policies let you define access permissions by specifying who has access to each resource, and the actions they are allowed to perform on each resource.
When you remove the
StreamSpecificationproperty from the template, DynamoDB disables the stream but retains any attached resource policy until the stream is deleted after 24 hours. When you modify theStreamViewTypeproperty, DynamoDB creates a new stream and retains the old stream's resource policy. The old stream and its resource policy are deleted after the 24-hour retention period.
In a CloudFormation template, you can provide the policy in JSON or YAML format because CloudFormation converts YAML to JSON before submitting it to DynamoDB . For more information about resource-based policies, see Using resource-based policies for DynamoDB and Resource-based policy examples .
1728 1729 1730 |
# File 'dynamo_db/cfn_table.rb', line 1728 def resource_policy @resource_policy end |
#stream_view_type ⇒ String (readonly)
When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
Valid values for StreamViewType are:
KEYS_ONLY- Only the key attributes of the modified item are written to the stream.NEW_IMAGE- The entire item, as it appears after it was modified, is written to the stream.OLD_IMAGE- The entire item, as it appeared before it was modified, is written to the stream.NEW_AND_OLD_IMAGES- Both the new and the old item images of the item are written to the stream.
1717 1718 1719 |
# File 'dynamo_db/cfn_table.rb', line 1717 def stream_view_type @stream_view_type end |
Class Method Details
.jsii_properties ⇒ Object
1730 1731 1732 1733 1734 1735 |
# File 'dynamo_db/cfn_table.rb', line 1730 def self.jsii_properties { :stream_view_type => "streamViewType", :resource_policy => "resourcePolicy", } end |
Instance Method Details
#to_jsii ⇒ Object
1737 1738 1739 1740 1741 1742 1743 1744 |
# File 'dynamo_db/cfn_table.rb', line 1737 def to_jsii result = {} result.merge!({ "streamViewType" => @stream_view_type, "resourcePolicy" => @resource_policy, }) result.compact end |