-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ValidationError: Parameter values specified when using DynamoDB Global module #2900
Comments
Looks as if I'm having a similar problem. I only have one global dynamodb table in my stack. It seems that the table itself is created, properly. It runs two stacks to do that - one for each region. Then it tries to create service roles and policies along with custom resources. It succeeds. Then I see this: Outputs: Stack ARN: ❌ dlief-capacity1 failed: ValidationError: Parameter values specified for a template which does not require them. |
This code will do it : import cdk = require("@aws-cdk/core");
import { AttributeType } from "@aws-cdk/aws-dynamodb";
import { GlobalTable } from "@aws-cdk/aws-dynamodb-global";
class GlobalStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new GlobalTable(this, "dlief-globdynamodb5", {
partitionKey: { name: "hashKey", type: AttributeType.STRING },
tableName: "dlief-GlobalTable1",
regions: ["us-east-1", "us-west-2"]
});
}
}
const app = new cdk.App();
new GlobalStack(app, "dlief-capacity5");
app.synth(); |
This is caused by a bug in how asset metadata is recorded when a sibling stack is defined as a child of another stack (not a nested stack): const parent = new Stack(app, 'parent');
const child = new Stack(parent, 'child');
new Asset(child, 'my-asset', { path }); The resulting manifest indicates that both |
When synthesizes the metadata section of a stack in the cloud assembly manifest, we traverse the tree below the stack and collect the metadata associated with all nodes in this tree. If this tree has a child stack, we don't need to collect the metadata from it's node, because they would appear in the metadata of that child stack. Metadata annotated on nested stack nodes will be recorded by the first non-nested stack parent. Specifically this bug caused an issue when the child stack used assets. Currently assets are reported through assembly metadata on the stack, and they would be reported both on the child and on the parent (although the CloudFormation parameters of the assets would not appear on the parent). This resulted in a CloudFormation error that reads: ValidationError: Parameter values specified for a template which does not require them. Therefore this fixes #2900
Fix in: #4540 |
* fix(core): child stack assembly metadata is duplidated on parent When synthesizes the metadata section of a stack in the cloud assembly manifest, we traverse the tree below the stack and collect the metadata associated with all nodes in this tree. If this tree has a child stack, we don't need to collect the metadata from it's node, because they would appear in the metadata of that child stack. Metadata annotated on nested stack nodes will be recorded by the first non-nested stack parent. Specifically this bug caused an issue when the child stack used assets. Currently assets are reported through assembly metadata on the stack, and they would be reported both on the child and on the parent (although the CloudFormation parameters of the assets would not appear on the parent). This resulted in a CloudFormation error that reads: ValidationError: Parameter values specified for a template which does not require them. Therefore this fixes #2900 * remove unused import
Describe the bug
Hi everybody,
I'm building an modular infrastructure but I'm fighting with this error:
The stack is very simple:
First stack:
A VPC only stack deployed with the
microservices-vpc-cdk-dev-us-west-2
stack name.Second stack:
A ECS Cluster + a Global DynamoDB Table, the ECS Cluster use exported parameters from the first stack.
The problem occurs on the second stack only if the Global DynamoDB Table is added; otherwise CDK works as expected.
To Reproduce
The ECS Cluster is very simple:
This configuration works as expected and the entire Stack are deployed, CDK create e deploy only a CF stack:
service1-ecs-cdk-dev-us-west-2
.By adding the DynamoDB Global Table definition under the ECS cluster I'm getting the error above:
Now CDK has created & deployed also:
service1ecscdkdevuswest2Service1TableCustomResourceBD055B07
service1ecscdkdevuswest2Service1TableService1Tableuswest2EBB183CF
Here a detailed log of the
cfn.createChangeSet
method invoked:Here the main
service1-ecs-cdk-dev-us-west-2
stack:Expected behavior
No parameters on the
service1-ecs-cdk-dev-us-west-2
stack.Version:
The text was updated successfully, but these errors were encountered: