Skip to content

Commit

Permalink
Merge pull request #1 from MarlonJD/merge-main
Browse files Browse the repository at this point in the history
feature(function): add custom runtimes to defineFunction
  • Loading branch information
MarlonJD authored Nov 25, 2024
2 parents a23f656 + 6c625a1 commit ad33727
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 255 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-berries-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-function': minor
---

add custom function type to defineFunction
14 changes: 3 additions & 11 deletions packages/backend-function/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
```ts

import { AmplifyResourceGroupName } from '@aws-amplify/plugin-types';
import { BackendSecret } from '@aws-amplify/plugin-types';
import { Construct } from 'constructs';
import { ConstructFactory } from '@aws-amplify/plugin-types';
import { FunctionResources } from '@aws-amplify/plugin-types';
import { IFunction } from 'aws-cdk-lib/aws-lambda';
import { ResourceAccessAcceptorFactory } from '@aws-amplify/plugin-types';
import { ResourceProvider } from '@aws-amplify/plugin-types';
import { StackProvider } from '@aws-amplify/plugin-types';

// @public (undocumented)
export type AddEnvironmentFactory = {
Expand All @@ -21,12 +21,7 @@ export type AddEnvironmentFactory = {
export type CronSchedule = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string} ${string} ${string}`;

// @public
export const defineFunction: (props?: FunctionProps) => ConstructFactory<ResourceProvider<FunctionResources> & ResourceAccessAcceptorFactory & AddEnvironmentFactory & StackProvider>;

// @public (undocumented)
export type FunctionBundlingOptions = {
minify?: boolean;
};
export const defineFunction: (props?: FunctionProps | ((scope: Construct) => IFunction)) => ConstructFactory<ResourceProvider<FunctionResources> & ResourceAccessAcceptorFactory & AddEnvironmentFactory>;

// @public (undocumented)
export type FunctionProps = {
Expand All @@ -37,9 +32,6 @@ export type FunctionProps = {
environment?: Record<string, string | BackendSecret>;
runtime?: NodeVersion;
schedule?: FunctionSchedule | FunctionSchedule[];
layers?: Record<string, string>;
bundling?: FunctionBundlingOptions;
resourceGroupName?: AmplifyResourceGroupName;
};

// @public (undocumented)
Expand Down
Loading

0 comments on commit ad33727

Please sign in to comment.