-
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
(assertions): incorrect validation error during GetLogEvents API call #30662
Comments
@msambol Good morning. Could you please share the self contained CDK code and packages used to reproduce the issue? Thanks, |
@ashishdhingra – It happened while running this integration test: https://github.com/aws/aws-cdk/pull/30665/files#diff-2763bd6ad8e804e782f19c082f9eac5be850ff7e79b98407aaa86f999985ec3b. |
@msambol Good afternoon. Thanks for sharing the input. Upon testing, looks like the parameter names for an API operation are case sensitive. If you refer GetLogEvents, the parameters logGroupName and logStreamName start with a lowercase letter. One more problem in your code is that you are not creating Log Stream. I was able to successfully deploy the below stack after making necessary changes: #!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-cdk-pipes-targets');
const test = new IntegTest(app, 'integtest-pipe-target-sqs', {
testCases: [stack],
});
const sourceQueue = new cdk.aws_sqs.Queue(stack, 'SourceQueue');
const body = 'Cozumel';
const targetLogGroup = new cdk.aws_logs.LogGroup(stack, 'TargetLogGroup');
const logStreamName = 'Mexico';
const targetLogStream = new cdk.aws_logs.LogStream(stack, 'TargetLogStream', {
logGroup: targetLogGroup,
logStreamName: logStreamName
});
const putMessageOnQueue = test.assertions.awsApiCall('SQS', 'sendMessage', {
QueueUrl: sourceQueue.queueUrl,
MessageBody: body,
});
new cdk.CfnOutput(stack, 'logGroupName', { value: targetLogGroup.logGroupName});
const message = putMessageOnQueue.next(test.assertions.awsApiCall('CloudWatchLogs', 'getLogEvents', {
logGroupName: targetLogGroup.logGroupName,
logStreamName: logStreamName,
}));
Just FYI, I added Thanks, |
@ashishdhingra Beautiful, thank you! |
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
I don't believe this is a CDK issue, but I'm hoping this can be routed to the correct team.
I wrote an integration test and used the following code:
I received the following error:
I tried both
LogGroupName
andLogGroupArn
.Expected Behavior
Log events to be returned
Current Behavior
ValidationException
Reproduction Steps
I wrote an integration test with the following code:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.147.1 (build d3695d4)
Framework Version
No response
Node.js Version
v20.11.1
OS
MacOS 14.6
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: