custom-resources: cannot make custom resource lambda function depend on a managed policy #27782
Labels
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
I am trying to create an AwsCustomResource with a VPC and role. The role has a managed policy attached to it, which grants the
ec2
actions necessary to create a Lambda function within a VPC. I have also manually set the managed policy as a dependency of the AwsCustomResource.Expected Behavior
Deploys successfully.
Current Behavior
The deploy fails with the following message:
Reproduction Steps
Possible Solution
Is it possible to make the AwsCustomResource construct a dependency of the Lambda Function it creates, thus preserving user-space constructs with the AwsCustomResource?
Additional Information/Context
It is possible to work around this issue by creating the managed policy, then passing it to the constructor of the role.
This work around isn't obvious, as it took me a while before I realized it.
CDK CLI Version
2.103.1
Framework Version
No response
Node.js Version
v18.18.2
OS
MacOs 13.6
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: