Skip to content

feat(aws/lambda): add event invoke config - #627

Merged
sam-goodwin merged 5 commits into
alchemy-run:mainfrom
mineiro:feat/aws-lambda-event-invoke-config
Jul 7, 2026
Merged

feat(aws/lambda): add event invoke config#627
sam-goodwin merged 5 commits into
alchemy-run:mainfrom
mineiro:feat/aws-lambda-event-invoke-config

Conversation

@mineiro

@mineiro mineiro commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Add Lambda asynchronous invocation settings (retries, event age, success/failure destinations) as an eventInvokeConfig prop on Function and Alias.

const fn = yield* AWS.Lambda.Function("AsyncFn", {
  main: "./src/handler.ts",
  eventInvokeConfig: {
    maximumRetryAttempts: 0,
    maximumEventAgeInSeconds: 60,
    destinationConfig: {
      OnFailure: {
        Destination: queue.queueArn,
      },
    },
  },
});

Alias-scoped config uses the same shape on AliasProps:

const alias = yield* AWS.Lambda.Alias("LiveAlias", {
  functionName: fn.functionName,
  functionVersion: version,
  aliasName: "live",
  eventInvokeConfig: { maximumRetryAttempts: 0 },
});

Both providers converge through a shared syncEventInvokeConfig helper: observe the live config, diff, then put — or delete it when the prop is omitted. Alias delete clears its qualifier-scoped config since Lambda does not remove it with the alias.

@sam-goodwin

Copy link
Copy Markdown
Contributor

Any reason not to make this a property on AWS.Lambda.FunctionProps? Alchemy supports circular dependencies, so I think there's less reason to model this as a separate resource.

@mineiro

mineiro commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Makes sense for the function-level case. One catch I noticed is that Lambda async config can also be scoped to a qualifier, so aliases/versions can have their own config.

Would you prefer this PR to only cover FunctionProps.eventInvokeConfig, and leave alias-specific config for a follow-up on AWS.Lambda.Alias?

@sam-goodwin

Copy link
Copy Markdown
Contributor

Would you prefer this PR to only cover FunctionProps.eventInvokeConfig, and leave alias-specific config for a follow-up on AWS.Lambda.Alias?

We can do it as part of this change since they're related.

sam-goodwin and others added 4 commits July 6, 2026 23:27
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-invoke-config

# Conflicts:
#	packages/alchemy/src/AWS/Providers.ts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s props

Per review: model async invocation settings as FunctionProps.eventInvokeConfig
and AliasProps.eventInvokeConfig instead of a standalone resource. The shared
syncEventInvokeConfig helper observes the live config, diffs, and puts or
deletes to converge.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sam-goodwin
sam-goodwin merged commit 74754b7 into alchemy-run:main Jul 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants