-
Notifications
You must be signed in to change notification settings - Fork 4k
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
AmplifyGraphqlApi: Validation error deploying AmplifyGraphqlApi CDK construct #27526
Comments
To add some additional details. Sometimes the
This causes an
|
I have similar issue and it looks that it is not the graphql api problem but something else. main.stack.ts import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { ApiStack } from "./api.stack";
export class MainStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new ApiStack(this, 'SuperTestApi');
}
} api.stack.ts import {Construct} from "constructs";
import {NestedStack} from "aws-cdk-lib";
export class ApiStack extends NestedStack {
constructor(scope: Construct, id: string) {
super(scope, id);
}
} Currently in ApiStack the props are not set because they are optional and stackName should be taken from stack id.
|
Same problem here with CDK code in Python. Node 18.18.1 |
Thank you for bringing this to our attention. This clearly shouldn't be happening, and this very much does look to be a regression. Thank you. |
Hi, Can you help us verify if this still exists in the latest 2.102.0 ? |
I am still seeing the issue in 2.102.0. |
Hi @pahud, It is still happening for me (I deployed two different solutions with the same error):
|
@eduborto Thanks for your prompt response. We'll review this internally. |
same issue with the 2.103.1 (build 3bb19ac) version. here is the demo code:
|
As this issue is related to the blog post, I will reach out to the blog post authors for inputs and verification. @wmz7year your comment seems to be related to EKS instead of Amplify? |
Hi @AnilMaktala If this error only happens with the code provided by that blog post, I'd recommend cutting a ticket to https://github.com/aws-amplify/amplify-category-api for clarifying. If you believe it's a general issue that exists in aws-cdk-lib, please provide a minimal code snippet in this issue so we can reproduce it on our end. |
The issue did exist in aws-cdk-lib and was surfaced when using the Amplify GraphQL API L3 construct. This issue was resolved with #27692. This issue can be closed now. |
Closing by #27692. |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
I am following the walkthrough in the CDK construct announcement blog post found here: https://aws.amazon.com/blogs/mobile/announcing-aws-amplifys-graphql-api-cdk-construct-deploy-real-time-graphql-api-and-data-stack-on-aws/. The only difference is I am deploying from a package in a pnpm monorepo, however, everything else is identical. During the cdk deploy logs I see the following error message:
Error occurred while monitoring stack: Error [ValidationError]: 2 validation errors detected: Value '' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]|arn:[-a-zA-Z0-9:/._+]; Value '' at 'stackName' failed to satisfy constraint: Member must have length greater than or equal to 1
at Request.extractError (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:46430)
at Request.callListeners (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:90083)
at Request.emit (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:89531)
at Request.emit (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:196289)
at Request.transition (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:189841)
at AcceptorStateMachine.runTo (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:154713)
at C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:155043
at Request. (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:190133)
at Request. (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:196364)
at Request.callListeners (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:90251) {
code: 'ValidationError',
time: 2023-10-12T14:16:28.072Z,
requestId: 'e828bd70-e9db-4173-8924-3dec501fccf6',
statusCode: 400,
retryable: false,
retryDelay: 142.81362092100824
}
Following deploy, the generated resources appear to work correctly.
Expected Behavior
No errors during cdk deploy
Current Behavior
During the cdk deploy logs I see the following error message:
Error occurred while monitoring stack: Error [ValidationError]: 2 validation errors detected: Value '' at 'stackName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]|arn:[-a-zA-Z0-9:/._+]; Value '' at 'stackName' failed to satisfy constraint: Member must have length greater than or equal to 1
at Request.extractError (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:46430)
at Request.callListeners (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:90083)
at Request.emit (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:89531)
at Request.emit (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:196289)
at Request.transition (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:189841)
at AcceptorStateMachine.runTo (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:154713)
at C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:155043
at Request. (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:190133)
at Request. (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:196364)
at Request.callListeners (C:...\AppData\Local\pnpm\global\5.pnpm\aws-cdk@2.100.0\node_modules\aws-cdk\lib\index.js:362:90251) {
code: 'ValidationError',
time: 2023-10-12T14:16:28.072Z,
requestId: 'e828bd70-e9db-4173-8924-3dec501fccf6',
statusCode: 400,
retryable: false,
retryDelay: 142.81362092100824
}
Reproduction Steps
Follow instructions found here: https://aws.amazon.com/blogs/mobile/announcing-aws-amplifys-graphql-api-cdk-construct-deploy-real-time-graphql-api-and-data-stack-on-aws/
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.100.0
Framework Version
No response
Node.js Version
18.18.0
OS
windows
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: