Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Any Resource?] - [BUG] - Error when replacing an old wait condition id with a new wait condition id in DependsOn #2220

Open
jedwards1211 opened this issue Dec 21, 2024 · 0 comments
Labels

Comments

@jedwards1211
Copy link

Name of the resource

AWS::CloudWatch::Alarm

Resource Name

No response

Issue Description

I tried working around #1097 by randomly generating a wait condition:

  const DbInstanceWaitCondition = `DbInstanceWaitCondition${randomstring.generate(
    { length: 12 }
  )}`

And then using it like so in my JS that generates the template:

  [DbInstanceWaitCondition]: {
    Type: 'AWS::CloudFormation::WaitCondition',
    CreationPolicy: {
      ResourceSignal: {
        Count: 1,
        Timeout:
          CreationTimeout === undefined
            ? 'PT15M'
            : CreationTimeout ?? undefined,
      },
    },
  },
  DiskUsageHighAlarm: {
    Type: 'AWS::CloudWatch::Alarm',
    DependsOn: [DbInstanceWaitCondition],
    Properties: {
      AlarmDescription: { 'Fn::Sub': '${AWS::StackName} Disk Usage High' },
      AlarmActions: [{ Ref: 'ServiceMonitoringSNSTopicArn' }],
      ComparisonOperator: 'GreaterThanThreshold',

Expected Behavior

I can update a stack with a new wait condition logical resource id without any problems

Observed Behavior

On update, I sometimes get buggy circular dependency errors:

CloudFormationServiceException [ValidationError]: Circular dependency between resources: [DiskUsageHighAlarm]

There are no references to DiskUsageHighAlarm anywhere in the template (only one result when I search for it), so there's no way it could be depending on itself.

Test Cases

  • Create a stack with a wait condition named WaitConditionA and another resource that depends on WaitConditionA
  • Signal WaitConditionA and wait for the stack to update
  • replace WaitConditionA with WaitConditionB in the template
  • Update the stack with the new template

Other Details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant