Class: AWSCDK::IAM::CommonGrantOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
iam/common_grant_options.rb

Overview

Basic options for a grant operation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actions:, grantee:, resource_arns:, conditions: nil) ⇒ CommonGrantOptions

Returns a new instance of CommonGrantOptions.

Parameters:

  • actions (Array<String>)

    The actions to grant.

  • grantee (AWSCDK::IAM::IGrantable)

    The principal to grant to.

  • resource_arns (Array<String>)

    The resource ARNs to grant to.

  • conditions (Hash{String => Hash{String => Object}}, nil) (defaults to: nil)

    Any conditions to attach to the grant.



11
12
13
14
15
16
17
18
19
20
# File 'iam/common_grant_options.rb', line 11

def initialize(actions:, grantee:, resource_arns:, conditions: nil)
  @actions = actions
  Jsii::Type.check_type(@actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "actions")
  @grantee = grantee
  Jsii::Type.check_type(@grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  @resource_arns = resource_arns
  Jsii::Type.check_type(@resource_arns, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "resourceArns")
  @conditions = conditions
  Jsii::Type.check_type(@conditions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoiYW55In0sImtpbmQiOiJtYXAifX0sImtpbmQiOiJtYXAifX0=")), "conditions") unless @conditions.nil?
end

Instance Attribute Details

#actionsArray<String> (readonly)

The actions to grant.

Returns:

  • (Array<String>)


25
26
27
# File 'iam/common_grant_options.rb', line 25

def actions
  @actions
end

#conditionsHash{String => Hash{String => Object}}? (readonly)

Note:

Default: - No conditions

Any conditions to attach to the grant.

Returns:

  • (Hash{String => Hash{String => Object}}, nil)


39
40
41
# File 'iam/common_grant_options.rb', line 39

def conditions
  @conditions
end

#granteeAWSCDK::IAM::IGrantable (readonly)

Note:

Default: if principal is undefined, no work is done.

The principal to grant to.



30
31
32
# File 'iam/common_grant_options.rb', line 30

def grantee
  @grantee
end

#resource_arnsArray<String> (readonly)

The resource ARNs to grant to.

Returns:

  • (Array<String>)


34
35
36
# File 'iam/common_grant_options.rb', line 34

def resource_arns
  @resource_arns
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
48
# File 'iam/common_grant_options.rb', line 41

def self.jsii_properties
  {
    :actions => "actions",
    :grantee => "grantee",
    :resource_arns => "resourceArns",
    :conditions => "conditions",
  }
end

Instance Method Details

#to_jsiiObject



50
51
52
53
54
55
56
57
58
59
# File 'iam/common_grant_options.rb', line 50

def to_jsii
  result = {}
  result.merge!({
    "actions" => @actions,
    "grantee" => @grantee,
    "resourceArns" => @resource_arns,
    "conditions" => @conditions,
  })
  result.compact
end