Skip to content

Commit

Permalink
Make LambdaInvoke prop optional as it can be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
samson-keung committed Oct 24, 2024
1 parent d884c7c commit 73f1634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class LambdaInvoke extends ScheduleTargetBase implements IScheduleTarget

constructor(
func: lambda.IFunction,
props: ScheduleTargetBaseProps,
props: ScheduleTargetBaseProps = {},
) {
super(props, func.functionArn);
this.func = func;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('schedule target', () => {
});

test('creates IAM role and IAM policy for lambda target in the same account', () => {
const lambdaTarget = new LambdaInvoke(func, {});
const lambdaTarget = new LambdaInvoke(func);

new Schedule(stack, 'MyScheduleDummy', {
schedule: expr,
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('schedule target', () => {
test('creates IAM policy for imported lambda function in the same account', () => {
const importedFunc = lambda.Function.fromFunctionArn(stack, 'ImportedFunction', 'arn:aws:lambda:us-east-1:123456789012:function/somefunc');

const lambdaTarget = new LambdaInvoke(importedFunc, {});
const lambdaTarget = new LambdaInvoke(importedFunc);

new Schedule(stack, 'MyScheduleDummy', {
schedule: expr,
Expand Down Expand Up @@ -330,7 +330,7 @@ describe('schedule target', () => {
},
);

const lambdaTarget = new LambdaInvoke(importedFunc, {});
const lambdaTarget = new LambdaInvoke(importedFunc);
new Schedule(stack, 'MyScheduleDummy', {
schedule: expr,
target: lambdaTarget,
Expand Down

0 comments on commit 73f1634

Please sign in to comment.