Class: AWSCDK::IAM::RoleGrants

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

Overview

Collection of grant methods for a IRoleRef.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RoleGrants

Returns a new instance of RoleGrants.

Raises:

  • (NoMethodError)


8
9
10
# File 'iam/role_grants.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_iam.RoleGrants does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.from_role(role) ⇒ AWSCDK::IAM::RoleGrants

Creates grants for IRoleRef.

Parameters:

Returns:

  • (AWSCDK::IAM::RoleGrants)


23
24
25
26
# File 'iam/role_grants.rb', line 23

def self.from_role(role)
  Jsii::Type.check_type(role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifQ==")), "role")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_iam.RoleGrants", "fromRole", [role])
end

.jsii_overridable_methodsObject



12
13
14
15
16
17
# File 'iam/role_grants.rb', line 12

def self.jsii_overridable_methods
  {
    :assume_role => { kind: :method, name: "assumeRole", is_optional: false },
    :pass_role => { kind: :method, name: "passRole", is_optional: false },
  }
end

Instance Method Details

#assume_role(identity) ⇒ AWSCDK::IAM::Grant

Grant permissions to the given principal to assume this role.

Parameters:

Returns:



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

def assume_role(identity)
  Jsii::Type.check_type(identity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklQcmluY2lwYWwifQ==")), "identity")
  jsii_call_method("assumeRole", [identity])
end

#pass_role(identity) ⇒ AWSCDK::IAM::Grant

Grant permissions to the given principal to pass this role.

Parameters:

Returns:



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

def pass_role(identity)
  Jsii::Type.check_type(identity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklQcmluY2lwYWwifQ==")), "identity")
  jsii_call_method("passRole", [identity])
end