aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.36 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImmutableRole=void 0;var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};class ImmutableRole extends core_1().Resource{constructor(scope,id,role,addGrantsToResources){super(scope,id,{account:role.env.account,region:role.env.region}),this.role=role,this.addGrantsToResources=addGrantsToResources,this.assumeRoleAction=this.role.assumeRoleAction,this.policyFragment=this.role.policyFragment,this.grantPrincipal=this,this.principalAccount=this.role.principalAccount,this.roleArn=this.role.roleArn,this.roleName=this.role.roleName,this.stack=this.role.stack,constructs_1().Dependable.implement(this,{dependencyRoots:[role]}),this.node.defaultChild=role.node.defaultChild}attachInlinePolicy(_policy){}addManagedPolicy(_policy){}addToPolicy(statement){return this.addToPrincipalPolicy(statement).statementAdded}addToPrincipalPolicy(_statement){return{statementAdded:!this.addGrantsToResources,policyDependable:new(constructs_1()).DependencyGroup}}grant(grantee,...actions){return this.role.grant(grantee,...actions)}grantPassRole(grantee){return this.role.grantPassRole(grantee)}grantAssumeRole(identity){return this.role.grantAssumeRole(identity)}}exports.ImmutableRole=ImmutableRole;