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

chore(scheduler-alpha): make LambdaInvoke prop optional #31887

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -89,7 +89,7 @@ describe('schedule target', () => {
const lambdaVersion = new lambda.Version(stack, 'MyLambdaVersion', {
lambda: func,
});
const lambdaTarget = new LambdaInvoke(lambdaVersion, {});
const lambdaTarget = new LambdaInvoke(lambdaVersion);

new Schedule(stack, 'MyScheduleDummy', {
schedule: expr,
Expand Down Expand Up @@ -250,7 +250,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 @@ -295,7 +295,7 @@ describe('schedule target', () => {
aliasName: 'SomeAliasName',
});

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

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

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