Skip to content

(aws-cdk-lib/custom-resources): L2 Provider construct generate circular dependency  #20360

@lmouhib

Description

@lmouhib

Describe the bug

When passing a role to the Provider the construct is no longer able to deploy correctly and fails with a circular dependency between the functions and policies generated by the Provider.

At CDK deploy time the deployment fails with Circular dependency between resources:

this where the construct is defined

https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_custom-resources.Provider.html

Expected Behavior

The Provider should deploy with the provider role without CFN failing with Circular dependency between resources:

Current Behavior

The Provider fail deploying with Circular dependency between resources:

Reproduction Steps

  1. Create a onEventHandler and isCompleteHandler Functions
  2. Create a role with service principal as lambda.amazonaws.com
  3. Create a Provider and pass to it the role and functions created above

Possible Solution

Fix the dependency on the Provider created resources.

Additional Information/Context

No response

CDK CLI Version

2.24.1 (build 585f9ca)

Framework Version

No response

Node.js Version

v14.17.6

OS

macOS Monterey

Language

Typescript

Language Version

4.1.6

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/custom-resourcesRelated to AWS CDK Custom ResourcesbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions