This message was deleted.
# aws
s
This message was deleted.
l
You'll need to do this.
c
Great, thanks for confirming
👍 1
This would be awesome to have an implicit dependency here. It prevents a component resource creating the execution role, then attaching additional resource policies to that execution policy outside of the component resource
l
Yes, though the explicit dependency is good for self-documentation purposes. And would there be cases where Pulumi would guess incorrectly? For example, if there were multiple RolePolicyAttachments and only one was relevant to the lambda?
c
Possible. Thoughts on this pattern?
Copy code
const 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?