Class: AWSCDK::IAM::RoleGrants
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::IAM::RoleGrants
- Defined in:
- iam/role_grants.rb
Overview
Collection of grant methods for a IRoleRef.
Class Method Summary collapse
-
.from_role(role) ⇒ AWSCDK::IAM::RoleGrants
Creates grants for IRoleRef.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#assume_role(identity) ⇒ AWSCDK::IAM::Grant
Grant permissions to the given principal to assume this role.
-
#initialize(*args) ⇒ RoleGrants
constructor
A new instance of RoleGrants.
-
#pass_role(identity) ⇒ AWSCDK::IAM::Grant
Grant permissions to the given principal to pass this role.
Constructor Details
#initialize(*args) ⇒ RoleGrants
Returns a new instance of RoleGrants.
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.
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_methods ⇒ Object
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.
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.
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 |