Class: AWSCDK::DynamoDB::StreamGrants

Inherits:
Jsii::Object
  • Object
show all
Defined in:
dynamo_db/stream_grants.rb

Overview

A set of permissions to grant on a Table Stream.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ StreamGrants

Returns a new instance of StreamGrants.



9
10
11
12
13
# File 'dynamo_db/stream_grants.rb', line 9

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::DynamoDB::StreamGrantsProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuU3RyZWFtR3JhbnRzUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



15
16
17
18
19
20
21
# File 'dynamo_db/stream_grants.rb', line 15

def self.jsii_overridable_methods
  {
    :actions => { kind: :method, name: "actions", is_optional: false },
    :list => { kind: :method, name: "list", is_optional: false },
    :read => { kind: :method, name: "read", is_optional: false },
  }
end

Instance Method Details

#actions(grantee, *actions) ⇒ AWSCDK::IAM::Grant

Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.

If encryption_key is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    The principal (no-op if undefined).

  • actions (Array<String>)

    The set of actions to allow (i.e. "dynamodb:DescribeStream", "dynamodb:GetRecords", ...).

Returns:



31
32
33
34
35
36
37
# File 'dynamo_db/stream_grants.rb', line 31

def actions(grantee, *actions)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  actions.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]")
  end
  jsii_call_method("actions", [grantee, *actions])
end

#list(grantee) ⇒ AWSCDK::IAM::Grant

Permits an IAM Principal to list streams attached to current dynamodb table.

Parameters:

Returns:



43
44
45
46
# File 'dynamo_db/stream_grants.rb', line 43

def list(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("list", [grantee])
end

#read(grantee) ⇒ AWSCDK::IAM::Grant

Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

Parameters:

Returns:



55
56
57
58
# File 'dynamo_db/stream_grants.rb', line 55

def read(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("read", [grantee])
end