Skip to content

Circular dependency between resources: potential issue with resourceConcurrency and stackConcurrency  #215

@turakvlad

Description

@turakvlad

We have the same issue as described in #122 and #188. The latest issue has been closed. That's why I decided to create a new issue.

If we have resourceConcurrency in our config, it does not allow us to deploy the stack for the first time (completely new deployment from scratch).

On the other hand, stackConcurrency works for the first deployment but does not work for subsequent ones.

To better show these issues, please take a look at the cases below.

The config below is not working if we want to deploy the stack for the first time:

  splitStacks:
    perFunction: true
    perType: false
    perGroupFunction: false
    stackConcurrency: 5
    resourceConcurrency: 10

We have this error:

Circular dependency between resources: [DisconnectIdpIamRoleLambdaExecution, DisconnectIdpLambdaFunction, ApiGatewayMethodUsersDisconnectDashidpOptions, ApiGatewayResourceUsersDisconnectDashidp, ApiGatewayMethodUsersDisconnectDashidpPost, DisconnectIdpLambdaPermissionApiGateway..., ].

Removing resourceConcurrency from the config above makes deploying the stack for the first time possible.

  splitStacks:
    perFunction: true
    perType: false
    perGroupFunction: false
    stackConcurrency: 5

However, the above config is not working for subsequent deployments. We have the same error as we have when trying to deploy the stack for the first time with resourceConcurrency set.

The CloudFormation template is invalid: Circular dependency between resources: [UpdateEmailTemplateNestedStack, CustomMessageNestedStack, SetDefaultEmailTemplateNestedStack, UpdateGroupNestedStack, ...].

It looks like resourceConcurrency creates some circular dependencies between resources and stackConcurrency does the same but between nested stacks (if that makes sense?).

Is there any way to handle this issue? Currently, we removed both options and left only:

  splitStacks:
    perFunction: true
    perType: false
    perGroupFunction: false

However, I am afraid that we will hit API rate limit errors in the nearest feature and the problem will arise again.

Thank you for any tips in advance! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions