-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
appsync: Log group for API is not created at deployment leading to "The specified log group does not exist" error when applying metric filter #26564
Comments
Looks like it assums the log group already exists. aws-cdk/packages/aws-cdk-lib/aws-appsync/lib/graphqlapi.ts Lines 566 to 568 in 960d14a
Reading the doc I guess you will need to enable the logging first? If this works for you, we probably should add this notice in the CDK doc. |
@pahud The logConfig is added if that's what you mean by enable logging first |
No from what I see in the source code, adding the |
@pahud ah, I see. Unfortunately that doesn't entirely work for us, because our CloudFormation stack deployment would fail after deploying the API but before enabling the logs then. Hoping for a CDK update here to support turning it on immediately after the API is created rather than needing to be a manual process |
We are hitting this bug too. Can |
For me even after logging was turned on, the log group was not getting created. I ran some queries and then log group was created. Is log group created lazily? This is not ideal. For first time deployment in new account/region, deployment fails and then rollback takes at least 20 mins before i can try another deployment. Please Fix this. |
…up (#28548) This change adds a dependency to log retention if logconfig is set for `GraphqlApi`. This in turn avoids the race condition when subsequent resources refer to the log group property of `GraphqlApi.logGroup` logGroup is now referring to the custom resource's output log ARN and further resources will depend on the custom resource to be created first. Closes #26564 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
facing same issue. May I know what query you had executed to create the log group ? |
+1. I also ran in this issue using Amplify Gen2. |
Describe the bug
I am deploying a GraphqlApi construct with a
logConfig
prop set with retention days as well. I am also callingapi.logGroup.addMetricFilter
in the same stack. However, I get this errorResource handler returned message: "The specified log group does not exist
. It appears that the log group is not created even when thelogConfig
prop is provided upon deployment. This is causing newly deployed stacks to fail.Expected Behavior
I would have expected the log group to be created when the API is created so that metric filters could be applied.
Current Behavior
I get a CloudFormation error of
Resource handler returned message: "The specified log group does not exist
and my stack fails to depoy.Reproduction Steps
Possible Solution
It appears that the code is simply looking for a log group name but not actually generating its own log group when the API is created. See here. A fix for this would be to ensure the log group is actually created rather than trying to load it by name.
Additional Information/Context
Some additional context is that I'm using VTL templates for some of my API resolvers. Because they don't natively have their own log groups or metrics, I'm leveraging adding a metric filter to the main API log group which is where the template resolvers log their logs/errors to.
CDK CLI Version
2.88.0
Framework Version
No response
Node.js Version
18
OS
macOS Ventura 13.4
Language
Typescript
Language Version
5.0.4
Other information
No response
The text was updated successfully, but these errors were encountered: