Nested stack synth fails with error when replicationRegions is set on DynamoDB Table.
import { Construct, Stack, StackProps } from '@aws-cdk/core';
import { NestedStack } from '@aws-cdk/aws-cloudformation';
import { Table, AttributeType } from '@aws-cdk/aws-dynamodb';
export class DynamoNestedStack extends NestedStack {
constructor(scope: Construct, id: string) {
super(scope, id);
new Table(this, 'MyTable', {
partitionKey: { name: 'pk', type: AttributeType.STRING },
replicationRegions: ['us-east-2', 'us-west-1'],
});
}
}
export class CdkNested6726Stack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
new DynamoNestedStack(this, 'DynamoStack');
}
}
Here's the error during synth.
throw new Error(`Nested stack '${sourceStack.node.path}' cannot depend on a parent stack '${targetStack.node.path}'`);
^
Error: Nested stack 'CdkNested6726Stack/DynamoStack' cannot depend on a parent stack 'CdkNested6726Stack'
I have tried this on CDK version 1.24.0, 1.25.0, 1.26.0, 1.27.0, and 1.28.0.
This is :bug: Bug Report
I thought the issue wasn't happening anymore.
I believe the synth was cached with cdk.out directory.
I upgraded to 1.28.0 and have the same error message during synth.
Updated title and description and added minimal reproduction.
Apologies for the initial issue. I had to dig around what was happening in my large stack.
I get the same error message whether the replication regions are specified inline as above or pulled from props.
Thanks @cmckni3 for opening this issue and being a NetsedStacks hero. We are on it!
Duplicate issue https://github.com/aws/aws-cdk/issues/6473
@NetaNir why did you reopen? Do you believe this is not a duplicate of #6473 ?
@NetaNir why did you reopen? Do you believe this is not a duplicate of #6473 ?
Accidentally, closing!
@NetaNir why did you reopen? Do you believe this is not a duplicate of #6473 ?
I actually think they are unrelated issues. In my minimal reproduction, I am not referencing anything across stacks.
I could be wrong and they are related at a code level but I don鈥檛 want this to get lost in the shuffle.
I think the confusion may come from the labels that were applied to my initial bug report. I did a lot more digging into the failure of my stack synth and updated the description after the labels were applied.
Will leave it up to CDK team but that鈥檚 my thoughts on the matter.
@cmckni3 replicationRegions is implemented using a custom resource in a nested stack.
I read further down in the comments of #6473 and it makes sense now. Didn't dig into the code to see how replication regions are implemented.
Thanks @jogold
Now, I receive a validation error from CloudFormation during deploy with CDK 1.34.1.
code: 'ValidationError',
time: 2020-04-25T01:59:51.888Z,
requestId: '<ID>',
statusCode: 400,
retryable: false,
retryDelay: 51.22703251258302
Tags must have length less than or equal to 50
Should I open a new issue?
Should I open a new issue?
Yes please.