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

feat(pipes-targets): add CloudWatch Logs #30665

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

msambol
Copy link
Contributor

@msambol msambol commented Jun 25, 2024

Add CloudWatch Logs as a Pipe target.

@github-actions github-actions bot added the p2 label Jun 25, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team June 25, 2024 20:47
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Jun 25, 2024
@msambol msambol marked this pull request as ready for review June 26, 2024 00:27
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 26, 2024
Copy link
Contributor

@nmussy nmussy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of nitpicks

* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetcloudwatchlogsparameters.html#cfn-pipes-pipe-pipetargetcloudwatchlogsparameters-timestamp
* @default - none
*/
readonly timestamp?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to have a number here? You can convert it back to a string in the constructor, and it reduces the chance that a user enters something like a ISO date

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get this to work in the Console even:

[ECMA 262 regex "^\$(\.[\w/_-]+(\[(\d+|\*)\])*)*$" does not match input string "1719416220650"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no regex expert but I can't make sense of that 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redwheeler3 is there a disconnect between the docs and the API? or am I missing something?

Copy link

@redwheeler3 redwheeler3 Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this one, we expect a JSONPath expression that references the timestamp in your payload. If you try the string "$.data.timestamp" it will validate. Leaving it blank updates it to the current time. We didn't think there was a use case here for specifying an actual time value... you either are going to want the current time or a time extracted from the payload of the event.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redwheeler3 I updated the above and added an example. I also confirmed $.data.timestamp worked in the Console. We should update the API docs.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 26, 2024
This was referenced Jul 1, 2024
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0aa06cb
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants