Skip to content

Commit

Permalink
Merge branch 'main' into colifran/migrate-log-retention
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 17, 2023
2 parents 4131220 + ff20d6b commit 0551837
Show file tree
Hide file tree
Showing 23 changed files with 314 additions and 2,155 deletions.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "4a61519d8f4df8206cfaff4e519462aa81beab9213c3642a1353cd679c697638.zip"
"S3Key": "b8cec122f25692e8b194663d25a2ee5e0b65e55df966120791d6a3ddc08fc136.zip"
},
"Handler": "index.handler",
"Role": {
Expand Down Expand Up @@ -91,7 +91,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "4a61519d8f4df8206cfaff4e519462aa81beab9213c3642a1353cd679c697638.zip"
"S3Key": "b8cec122f25692e8b194663d25a2ee5e0b65e55df966120791d6a3ddc08fc136.zip"
},
"Handler": "index.handler",
"Role": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
/* eslint-disable no-console */
import { Event } from '../evaluate-expression';

/**
* The event received by the Lambda function
*
* @internal
*/
export interface Event {
/**
* The expression to evaluate
*/
readonly expression: string;

/**
* The expression attribute values
*/
readonly expressionAttributeValues: { [key: string]: any };
}

function escapeRegex(x: string) {
return x.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
Expand All @@ -15,5 +31,6 @@ export async function handler(event: Event): Promise<any> {
);
console.log(`Expression: ${expression}`);

return eval(expression);
// direct eval with bundler is not recommended - using indirect eval
return [eval][0](expression);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Event } from '../lib';
import { handler } from '../lib/eval-nodejs-handler';
import { handler, Event } from '../../lib/aws-stepfunctions-tasks/eval-nodejs-handler';

beforeAll(() => {
jest.spyOn(console, 'log').mockImplementation();
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface EvaluateExpressionProps extends sfn.TaskStateBaseProps {
/**
* The event received by the Lambda function
*
* Shared definition with packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-stepfunctions-tasks/index.ts
*
* @internal
*/
export interface Event {
Expand Down Expand Up @@ -119,7 +121,7 @@ function createEvalFn(runtime: lambda.Runtime | undefined, scope: Construct) {
uuid,
handler: 'index.handler',
lambdaPurpose,
code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler'), {
code: lambda.Code.fromAsset(path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-stepfunctions-tasks', 'eval-nodejs-handler'), {
exclude: ['*.ts'],
}),
});
Expand Down
Loading

0 comments on commit 0551837

Please sign in to comment.