-
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
[api-gateway] Access log must include at least AccessLogFormat.contextRequestId()
when tokenized format is passed
#9687
Comments
@vad3x - As called out in the error message, the string value passed to Update your string to include this. accessLogFormat: apigateway.AccessLogFormat.custom(`${AccessLogFormat.contextRequestId()} ${props.apiGatewayAcessLogFormatSsmKey}`), |
@nija-at Thank you for the workaround. I guess your proposal will omit the error, but this will change the expected log format provided by the external output (SSM in my case). |
This is a requirement enforced by API Gateway - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-stage-accesslogsetting.html#cfn-apigateway-stage-accesslogsetting-format |
Correct, but I'm not sure why you do the check on CDK sync level, I assume CF will fail the resource creating in case when Expected CDK output:
This is working CF output because The check which you have just make the scenario not possible to implement. |
Ah ok, I see what the problem is. We need to exclude the validation if the string is a token. |
Looks like that 👍 |
fixes #9687 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to use
Stage
construct with format by SSM key (so my format is similar to'${Token[TOKEN.65]}'
).Reproduction Steps
What did you expect to happen?
No error.
What actually happened?
Error: "Access log must include at least
AccessLogFormat.contextRequestId()
"https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-apigateway/lib/stage.ts#L213
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: