Class: AWSCDK::IoT::CfnTopicRule::DynamoDBv2ActionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t/cfn_topic_rule.rb

Overview

Describes an action to write to a DynamoDB table.

This DynamoDB action writes each attribute in the message payload into it's own column in the DynamoDB table.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(put_item: nil, role_arn: nil) ⇒ DynamoDBv2ActionProperty

Returns a new instance of DynamoDBv2ActionProperty.

Parameters:



1382
1383
1384
1385
1386
1387
# File 'io_t/cfn_topic_rule.rb', line 1382

def initialize(put_item: nil, role_arn: nil)
  @put_item = put_item.is_a?(Hash) ? ::AWSCDK::IoT::CfnTopicRule::PutItemInputProperty.new(**put_item.transform_keys(&:to_sym)) : put_item
  Jsii::Type.check_type(@put_item, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3QuQ2ZuVG9waWNSdWxlLlB1dEl0ZW1JbnB1dFByb3BlcnR5In1dfX0=")), "putItem") unless @put_item.nil?
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn") unless @role_arn.nil?
end

Instance Attribute Details

#put_itemAWSCDK::IResolvable, ... (readonly)

Specifies the DynamoDB table to which the message data will be written. For example:.

{ "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

Each attribute in the message payload will be written to a separate column in the DynamoDB database.



1397
1398
1399
# File 'io_t/cfn_topic_rule.rb', line 1397

def put_item
  @put_item
end

#role_arnString? (readonly)

The ARN of the IAM role that grants access to the DynamoDB table.



1402
1403
1404
# File 'io_t/cfn_topic_rule.rb', line 1402

def role_arn
  @role_arn
end

Class Method Details

.jsii_propertiesObject



1404
1405
1406
1407
1408
1409
# File 'io_t/cfn_topic_rule.rb', line 1404

def self.jsii_properties
  {
    :put_item => "putItem",
    :role_arn => "roleArn",
  }
end

Instance Method Details

#to_jsiiObject



1411
1412
1413
1414
1415
1416
1417
1418
# File 'io_t/cfn_topic_rule.rb', line 1411

def to_jsii
  result = {}
  result.merge!({
    "putItem" => @put_item,
    "roleArn" => @role_arn,
  })
  result.compact
end