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

aws-pipes: CfnPipe doesn't set the CloudWatch Log Group in AWS Console #31665

Open
1 task
garysassano opened this issue Oct 5, 2024 · 2 comments
Open
1 task
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@garysassano
Copy link

Describe the bug

I deployed this EventbridgeStack and then checked the configuration for one of the Pipes in the AWS Console.

I noticed something curious:

image

The CloudWatch log group appears as NOT selected in the UI, yet it is actually selected (otherwise, it wouldn’t function properly).

Let's double-check:

  1. Open the dropdown menu and select the same log group specified in the EventbridgeStack.
  2. Save the Pipe.
  3. Run cdk deploy again.

You’ll observe that no changes are made, which indicates the log group was correctly applied despite the UI showing otherwise. This seems to be a UI bug that occurs when deploying via CDK, and it might also affect deployments through CloudFormation directly.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

See above.

Current Behavior

See above.

Reproduction Steps

See above.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.161.1

Framework Version

No response

Node.js Version

20.18.0

OS

Ubuntu 22.04

Language

TypeScript

Language Version

No response

Other information

No response

@garysassano garysassano added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 5, 2024
@github-actions github-actions bot added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Oct 5, 2024
@garysassano garysassano changed the title @aws-cdk/aws-pipes-alpha: CfnPipe doesn't set the CloudWatch Log Group in AWS Console aws_pipes: CfnPipe doesn't set the CloudWatch Log Group in AWS Console Oct 5, 2024
@garysassano garysassano changed the title aws_pipes: CfnPipe doesn't set the CloudWatch Log Group in AWS Console aws-pipes: CfnPipe doesn't set the CloudWatch Log Group in AWS Console Oct 5, 2024
@pahud
Copy link
Contributor

pahud commented Oct 6, 2024

I deployed this EventbridgeStack and then checked the configuration for one of the Pipes in the AWS Console.

Before the deployment, if you run npx cdk diff, did you see any log group resource to be created?

The CloudWatch log group appears as NOT selected in the UI, yet it is actually selected (otherwise, it wouldn’t function properly).

And, instead of the external repo provided, are you able to provide a minimal code snippets in Reproduction Steps that reproduces this issue?

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Oct 6, 2024
@garysassano
Copy link
Author

Here's a minimal reproducible example using the Pipe L2 construct (which uses CfnPipe under the hood):

const ddbTable = new TableV2(this, "DDBTable", {
  tableName: "ddb-table",
  partitionKey: {
    name: "Location",
    type: AttributeType.STRING,
  },
  dynamoStream: StreamViewType.NEW_AND_OLD_IMAGES,
  removalPolicy: RemovalPolicy.DESTROY,
});

const queue = new Queue(this, "Queue", {
  retentionPeriod: Duration.days(14),
});

const pipeSource = new DynamoDBSource(ddbTable, {
  startingPosition: DynamoDBStartingPosition.LATEST,
  batchSize: 1,
  maximumRetryAttempts: 0,
});

const logGroup = new LogGroup(this, "AccessLogs", {
  retention: RetentionDays.THREE_MONTHS,
  removalPolicy: RemovalPolicy.DESTROY,
});

const cwLogDestination: ILogDestination = {
  bind: () => ({
    parameters: {
      cloudwatchLogsLogDestination: {
        logGroupArn: logGroup.logGroupArn,
      },
    },
  }),
  grantPush: (grantee) => {
    logGroup.grantWrite(grantee);
  },
};

new Pipe(this, "Pipe", {
  source: pipeSource,
  target: new SqsTarget(queue),
  logDestinations: [cwLogDestination],
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants