Skip to content

Conversation

Abhijoy-Mandal
Copy link
Contributor

@Abhijoy-Mandal Abhijoy-Mandal commented Jul 1, 2025

Issue # (if applicable)

Closes #34861.

Reason for this change

Creates CDK constructs for CloudWatch Logs Transformers. Transformers already have CFN constructs and this achieves functional parity.

Description of changes

Added a Transformer construct which is an abstraction over cfnTransformer.

Created a factory class ProcessorFactory with static methods to create each of the 5 overarching types of processors described in https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation-Processors.html, namely: ParserProcessor, VendedLogParser, StringMutatorProcessor, JsonMutatorProcessor and DataConverterProcessor.
These classes implement a _bind() method responsible for returning the props expected by CFN constructs for each processor of the respective types.
These classes are further split into their processors defined by enums (ParserProcessorType, VendedLogType, StringMutatorType, JsonMutatorType, DataConverterType) and properties for each processor.

A Transformer expects a transformerConfig which is a list of processors. Processors can be created using the static methods createParserProcessor, createVendedLogParser, createStringMutatorProcessor, createJsonMutatorProcessor and createDataConverterProcessor in the ProcessorFactory, by passing the type (from the enums defined above) and the relevant props for that processor. ValidationError is thrown if the expected/required props are not passed.

Further validations are performed for limit breaches or positions of parsers being incorrect.

Describe any new or updated permissions being added

Description of how you validated changes

Added unit tests for each processor and each validation. Added integ test.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK feature-request A feature should be added or improved. p2 labels Jul 1, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team July 1, 2025 01:00
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@Abhijoy-Mandal Abhijoy-Mandal changed the title Cloudwatch logs transformer support feat: Cloudwatch logs transformer support Jul 1, 2025
@Abhijoy-Mandal Abhijoy-Mandal changed the title feat: Cloudwatch logs transformer support feat: cloudwatch logs transformer support Jul 1, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review July 1, 2025 04:14

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@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 Jul 1, 2025
@pahud pahud mentioned this pull request Jul 2, 2025
2 tasks
@rix0rrr rix0rrr self-assigned this Jul 8, 2025
@Abhijoy-Mandal Abhijoy-Mandal requested a review from rix0rrr July 9, 2025 20:19
rix0rrr
rix0rrr previously approved these changes Jul 10, 2025
Copy link
Contributor

mergify bot commented Jul 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@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 Jul 10, 2025
Copy link
Contributor

mergify bot commented Jul 10, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mergify bot added a commit that referenced this pull request Jul 10, 2025
Copy link
Contributor

mergify bot commented Jul 10, 2025

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #34863 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: 2 of 2 required status checks are expected.).

You can check the last failing draft PR here: #34956.

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@alvazjor
Copy link
Contributor

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Jul 11, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

Copy link
Contributor

mergify bot commented Jul 11, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated.

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mergify mergify bot dismissed rix0rrr’s stale review July 11, 2025 13:47

Pull request has been modified.

@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 Jul 11, 2025
@alvazjor alvazjor removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 11, 2025
@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 Jul 11, 2025
alvazjor
alvazjor previously approved these changes Jul 11, 2025
@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 Jul 11, 2025
@mergify mergify bot dismissed alvazjor’s stale review July 11, 2025 16:26

Pull request has been modified.

@Abhijoy-Mandal
Copy link
Contributor Author

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Jul 11, 2025

requeue

❌ Command disallowed due to command restrictions in the Mergify configuration.

  • sender-permission >= write

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Jul 11, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 481a9d2 into aws:main Jul 11, 2025
20 checks passed
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-logs): Transformer support
4 participants