curved-pharmacist-41509
05/31/2021, 3:15 AMconst role = new Role('role')
const policy = new Policy('policy', {})
const rpa = new RolePolicyAttachment('rpa', { role, policy })
const myLambda = new Lambda('lambda', { executionRole: role }, { dependsOn: [rpa] })
little-cartoon-10569
05/31/2021, 3:18 AMcurved-pharmacist-41509
05/31/2021, 3:19 AMlittle-cartoon-10569
05/31/2021, 3:23 AMcurved-pharmacist-41509
05/31/2021, 3:54 AMconst executionRole = new LambdaExecutionRole()
new Lambda('', { role: executionRole.role }, { dependsOn: [executionRole] }))
executionRole.attachPolicy(...)
This would create a role policy attachment with parent of the LambdaExecutionRole. Allowing role policy attachments to be added after the lambda has been `new`ed up, but also creating a dependency between the RPA’s and hte lambda?