Class: AWSCDK::IAM::GrantOnPrincipalOptions

Inherits:
CommonGrantOptions
  • Object
show all
Defined in:
iam/grant_on_principal_options.rb

Overview

Options for a grant operation that only applies to principals.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of GrantOnPrincipalOptions.

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.

  • scope (Constructs::IConstruct, nil) (defaults to: nil)

    Construct to report warnings on in case grant could not be registered.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'iam/grant_on_principal_options.rb', line 12

def initialize(actions:, grantee:, resource_arns:, conditions: nil, scope: 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?
  @scope = scope
  Jsii::Type.check_type(@scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope") unless @scope.nil?
end

Instance Attribute Details

#actionsArray<String> (readonly)

The actions to grant.

Returns:

  • (Array<String>)


28
29
30
# File 'iam/grant_on_principal_options.rb', line 28

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)


42
43
44
# File 'iam/grant_on_principal_options.rb', line 42

def conditions
  @conditions
end

#granteeAWSCDK::IAM::IGrantable (readonly)

Note:

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

The principal to grant to.



33
34
35
# File 'iam/grant_on_principal_options.rb', line 33

def grantee
  @grantee
end

#resource_arnsArray<String> (readonly)

The resource ARNs to grant to.

Returns:

  • (Array<String>)


37
38
39
# File 'iam/grant_on_principal_options.rb', line 37

def resource_arns
  @resource_arns
end

#scopeConstructs::IConstruct? (readonly)

Deprecated.

The scope argument is currently unused.

Note:

Default: - the construct in which this construct is defined

Construct to report warnings on in case grant could not be registered.

Returns:

  • (Constructs::IConstruct, nil)


48
49
50
# File 'iam/grant_on_principal_options.rb', line 48

def scope
  @scope
end

Class Method Details

.jsii_propertiesObject



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

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

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
71
# File 'iam/grant_on_principal_options.rb', line 60

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