Skip to content

feat(reportextractor): GuCDK defined lambda - #1616

Merged
akash1810 merged 6 commits into
mainfrom
aa/reportextractor-cdk
Jan 15, 2026
Merged

feat(reportextractor): GuCDK defined lambda#1616
akash1810 merged 6 commits into
mainfrom
aa/reportextractor-cdk

Conversation

@akash1810

@akash1810 akash1810 commented Jan 13, 2026

Copy link
Copy Markdown
Member

Note

Easiest to review commit by commit.

What does this change?

Follows #1612, adding a GuCDK defined version of the reportextractor lambda to the report CFN stack. That is, this change yields the following CFN stacks and resources:

  • CFN stack report with report EC2 app and reportextractor lambda
  • CFN stack reportextractor with reportextractor lambda1

The GuCDK version isn't an exact replica of the YAML defined one. Most notably the custom CloudWatch Logs policy is not replicated as it isn't necessary; lambdas implicitly have permissions to write to CloudWatch Logs via AWSLambdaBasicExecutionRole and the application code does not produce CloudWatch Metrics.

How to test

  1. Deploy this branch

  2. Invoke the legacy YAML defined lambda (logs)

    ❯ aws lambda invoke --function-name legacy-mobile-notifications-reportextractor-CODE --profile mobile --region eu-west-1 /tmp/response.json
  3. Calculate the SHA-256 of the notifications.json output file

    ❯ aws s3 cp s3://ophan-raw-push-notification/code-data/date=2026-01-13/notifications.json /tmp/notifications.json --profile ophan --region eu-west-1
    ❯ shasum -a 256 /tmp/notifications.json
    
    0d8bfbe69493fe0bb01ee6fadfc90c5df88758f429059a2e1cf9714106edb850  /tmp/notifications.json
  4. Invoke the GuCDK defined lambda (logs)

    ❯ aws lambda invoke --function-name mobile-notifications-reportextractor-CODE --profile mobile --region eu-west-1 /tmp/response.json
  5. Calculate the SHA-256 of the notifications.json output file and compare it to step 3, it should match.

    ❯ aws s3 cp s3://ophan-raw-push-notification/code-data/date=2026-01-13/notifications.json /tmp/notifications.json --profile ophan --region eu-west-1
    ❯ shasum -a 256 /tmp/notifications.json
    
    0d8bfbe69493fe0bb01ee6fadfc90c5df88758f429059a2e1cf9714106edb850  /tmp/notifications.json

Footnotes

  1. A follow-up PR to remove the reportextractor CFN stack will be made after this PR.

@github-actions

github-actions Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@akash1810
akash1810 changed the base branch from aa/rm-param-rename to aa/report-merge January 13, 2026 12:00
@akash1810
akash1810 changed the base branch from aa/report-merge to aa/rm-param-rename January 13, 2026 12:00
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from 82b4fc3 to d809d01 Compare January 13, 2026 14:04
@akash1810
akash1810 changed the base branch from aa/rm-param-rename to aa/report-merge January 13, 2026 14:04
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from ce2911b to 7d64dae Compare January 13, 2026 14:19
Base automatically changed from aa/report-merge to main January 13, 2026 15:02
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from 7d64dae to 8121be2 Compare January 13, 2026 15:22
akash1810 added a commit that referenced this pull request Jan 14, 2026
In #1616 we're defining the lambda in GuCDK.
We'll have to configure Riff-Raff to discover the new lambda via a name tag discovery fails when multiple lambdas are matched.
To support this, rename the YAML lambda with the "legacy" prefix so that the GuCDK lambda can be named "mobile-notifications-reportextractor-(CODE|PROD)".
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from 8121be2 to 4df30d0 Compare January 14, 2026 09:26
@akash1810
akash1810 changed the base branch from main to aa/legacy-reportextractor January 14, 2026 09:27
@akash1810 akash1810 added the feature Departmental tracking: work on a new feature label Jan 14, 2026
akash1810 added a commit that referenced this pull request Jan 14, 2026
In #1616 we're defining the lambda in GuCDK.
We'll have to configure Riff-Raff to discover the new lambda via a name tag discovery fails when multiple lambdas are matched.
To support this, rename the YAML lambda with the "legacy" prefix so that the GuCDK lambda can be named "mobile-notifications-reportextractor-(CODE|PROD)".
@akash1810
akash1810 force-pushed the aa/legacy-reportextractor branch from 4413239 to fdd96c5 Compare January 14, 2026 12:32
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from 535c596 to 7343102 Compare January 14, 2026 12:32
Base automatically changed from aa/legacy-reportextractor to main January 14, 2026 14:11
Defining the reportextractor lambda in GuCDK.
This definition is in parallel to the one in `reportextractor/cfn.yaml`.
Match the additional permissions in the YAML that are not provided by default from GuCDK.
Riff-Raff's tag based lambda discovery expects to find one lambda.

Currently, the YAML and GuCDK lambdas have the same tags,
therefore we have to configure `riff-raff.yaml` with `functionNames`
and explicitly name the GuCDK lambda.
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from 7343102 to f26ffd2 Compare January 14, 2026 14:20
To prevent the YAML and GuCDK lambda from running at the same time,
and over-writing each other's output, disable the schedule for the YAML lambda.
@akash1810
akash1810 force-pushed the aa/reportextractor-cdk branch from 9551b12 to 62bf839 Compare January 14, 2026 14:28
@akash1810
akash1810 marked this pull request as ready for review January 14, 2026 14:56
@akash1810
akash1810 requested a review from a team as a code owner January 14, 2026 14:56
akash1810 added a commit that referenced this pull request Jan 14, 2026
Since #1616, this lambda is defined in GuCDK.
Note, this change doesn't delete the CloudFormation stack, we'd need to do this manually.
@akash1810
akash1810 merged commit 27dca50 into main Jan 15, 2026
5 checks passed
@akash1810
akash1810 deleted the aa/reportextractor-cdk branch January 15, 2026 08:16
akash1810 added a commit that referenced this pull request Jan 15, 2026
Since #1616, this lambda is defined in GuCDK.
Note, this change doesn't delete the CloudFormation stack, we'd need to do this manually.
akash1810 added a commit that referenced this pull request Jan 16, 2026
Since #1616, this lambda is defined in GuCDK.
Note, this change doesn't delete the CloudFormation stack, we'd need to do this manually.
akash1810 added a commit that referenced this pull request Jan 19, 2026
Since #1616, this lambda is defined in GuCDK.
Note, this change doesn't delete the CloudFormation stack, we'd need to do this manually.
akash1810 added a commit that referenced this pull request Jan 20, 2026
Since #1616, this lambda is defined in GuCDK.
Note, this change doesn't delete the CloudFormation stack, we'd need to do this manually.
akash1810 added a commit that referenced this pull request Jan 22, 2026
Since #1616, this lambda is defined in GuCDK.
Note, this change doesn't delete the CloudFormation stack, we'd need to do this manually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants