Skip to content
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

(pipes): 'logConfiguration' does not exist in type 'CfnPipeProps' #28352

Closed
Kenichiro-Wada opened this issue Dec 13, 2023 · 3 comments
Closed
Labels
@aws-cdk/aws-events Related to CloudWatch Events bug This issue is a bug. effort/small Small work item – less than a day of effort response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@Kenichiro-Wada
Copy link

Describe the bug

The documentation says that logConfiguration can be specified as a property of CfnPipe, but when I configure it and try to deploy, I get an Object literal may only specify known properties, and 'logConfiguration' does not exist in type 'CfnPipeProps'. message.

LogConfiguration:{
  cloudwatchLogsLogDestination: {
    logGroupArn: eventBridgeLogGroup.logGroupArn,
  },
},

Expected Behavior

When the configuration is complete and EventBridge Pipes are running, the Pipe execution log is output to Cloudwatch Logs.

Current Behavior

The following error message is displayed(This is running on Cloud9)

lib/cdk-eventbridge-pipes-ecs-tasks-stack.ts:202:7 - error TS2345: Argument of type '{ name: string; roleArn: string; source: string; target: string; sourceParameters: { sqsQueueParameters: { batchSize: number; }; }; LogConfiguration: { cloudwatchLogsLogDestination: { logGroupArn: string; }; }; targetParameters: { ...; }; }' is not assignable to parameter of type 'CfnPipeProps'.
  Object literal may only specify known properties, but 'LogConfiguration' does not exist in type 'CfnPipeProps'. Did you mean to write 'logConfiguration'?

202       LogConfiguration:{
          ~~~~~~~~~~~~~~~~

    at createTSError (/home/ec2-user/environment/cdk-eventbridge-pipes-ecs-tasks/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/home/ec2-user/environment/cdk-eventbridge-pipes-ecs-tasks/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/home/ec2-user/environment/cdk-eventbridge-pipes-ecs-tasks/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/home/ec2-user/environment/cdk-eventbridge-pipes-ecs-tasks/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/home/ec2-user/environment/cdk-eventbridge-pipes-ecs-tasks/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .ts] (/home/ec2-user/environment/cdk-eventbridge-pipes-ecs-tasks/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
  diagnosticCodes: [ 2345 ]
}

Subprocess exited with error 1

Reproduction Steps

Create a stack with the following stack and attempt to synthesize the stack:

import { RemovalPolicy, ScopedAws, Stack, StackProps, Duration} from "aws-cdk-lib";
import { Construct } from "constructs";
import { CfnPipe } from 'aws-cdk-lib/aws-pipes';

export class TestStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);
    new CfnPipe(this, 'Pipe', {
      name: `${resourceName}-pipe`,
      roleArn: eventBridgePipeRole.roleArn,
      source: queue.queueArn,
      target: ecsCluster.clusterArn,
      LogConfiguration:{
        cloudwatchLogsLogDestination: {
          logGroupArn: eventBridgeLogGroup.logGroupArn,
        },
      },
      sourceParameters: {
        sqsQueueParameters: {
          batchSize: 1
        }
      },
      targetParameters: {
        ecsTaskParameters: {
          taskDefinitionArn: ecsTaskDefinition.taskDefinitionArn,
          taskCount: 1,
          launchType: 'FARGATE',
          networkConfiguration: {
            awsvpcConfiguration: {
              subnets: subnets.subnetIds,
              assignPublicIp: 'ENABLED'
            }
          },
          overrides: {
            containerOverrides: [
              {
                name: `${resourceName}-container`,
                environment: [
                  {
                    name: "MESSAGE",
                    value: "$.body.message"
                  },
                ],
                command: [
                  "python",
                  "app.py"
                ],
              }
            ]
          }
        }
      }
    });
  }
}

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.114.1 (build 02bbb1d)

Framework Version

No response

Node.js Version

v18.17.1

OS

Linux

Language

TypeScript

Language Version

3.7.5

Other information

No response

@Kenichiro-Wada Kenichiro-Wada added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 13, 2023
@github-actions github-actions bot added the @aws-cdk/aws-events Related to CloudWatch Events label Dec 13, 2023
@pahud
Copy link
Contributor

pahud commented Dec 13, 2023

I guess you should lowercase the capital L

    logConfiguration:{
      cloudwatchLogsLogDestination: {
        logGroupArn: eventBridgeLogGroup.logGroupArn,
      },
    },

And you should be able to see the warning like this in your IDE.

image

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 13, 2023
@Kenichiro-Wada
Copy link
Author

@pahud
Thank you. It seems to be my mistake.
And there was an application in the same IDE (Cloud9) that was using an older version of aws-cdk-lib, and it seemed that logConfiguration was also giving an error there. I have updated it to the latest version, and it was resolved.
I will close this one.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events Related to CloudWatch Events bug This issue is a bug. effort/small Small work item – less than a day of effort response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants