File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ interface FunctionConfig {
250
250
}
251
251
252
252
function addEdgeLambdaToRoleTrustStatement ( role : iam . IRole ) {
253
- if ( role instanceof iam . Role && role . assumeRolePolicy ) {
253
+ if ( iam . Role . isRole ( role ) && role . assumeRolePolicy ) {
254
254
const statement = new iam . PolicyStatement ( ) ;
255
255
const edgeLambdaServicePrincipal = new iam . ServicePrincipal ( 'edgelambda.amazonaws.com' ) ;
256
256
statement . addPrincipals ( edgeLambdaServicePrincipal ) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export class CacheBehavior {
75
75
if ( ! edgeLambdas || edgeLambdas . length === 0 ) { return ; }
76
76
edgeLambdas . forEach ( ( edgeLambda ) => {
77
77
const role = edgeLambda . functionVersion . role ;
78
- if ( role && role instanceof iam . Role && role . assumeRolePolicy ) {
78
+ if ( role && iam . Role . isRole ( role ) && role . assumeRolePolicy ) {
79
79
role . assumeRolePolicy . addStatements ( new iam . PolicyStatement ( {
80
80
actions : [ 'sts:AssumeRole' ] ,
81
81
principals : [ new iam . ServicePrincipal ( 'edgelambda.amazonaws.com' ) ] ,
Original file line number Diff line number Diff line change @@ -1053,7 +1053,7 @@ export class CloudFrontWebDistribution extends cdk.Resource implements IDistribu
1053
1053
1054
1054
// allow edgelambda.amazonaws.com to assume the functions' execution role.
1055
1055
for ( const a of input . lambdaFunctionAssociations ) {
1056
- if ( a . lambdaFunction . role && a . lambdaFunction . role instanceof iam . Role && a . lambdaFunction . role . assumeRolePolicy ) {
1056
+ if ( a . lambdaFunction . role && iam . Role . isRole ( a . lambdaFunction . role ) && a . lambdaFunction . role . assumeRolePolicy ) {
1057
1057
a . lambdaFunction . role . assumeRolePolicy . addStatements ( new iam . PolicyStatement ( {
1058
1058
actions : [ 'sts:AssumeRole' ] ,
1059
1059
principals : [ new iam . ServicePrincipal ( 'edgelambda.amazonaws.com' ) ] ,
Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ export class Pipeline extends PipelineBase {
764
764
// because the role might be from a different environment),
765
765
// but _only_ if it's a new Role -
766
766
// an imported Role should not add the dependency
767
- if ( action . actionProperties . role instanceof iam . Role ) {
767
+ if ( iam . Role . isRole ( action . actionProperties . role ) ) {
768
768
const roleStack = Stack . of ( action . actionProperties . role ) ;
769
769
pipelineStack . addDependency ( roleStack ) ;
770
770
}
You can’t perform that action at this time.
0 commit comments