From 1837cf3c504642d5d77e34f084dd94990c02b09c Mon Sep 17 00:00:00 2001 From: Amplifiyer Date: Wed, 22 Jan 2025 11:32:09 -0500 Subject: [PATCH] Add callouts for backend-function configuration not supported in custom functions --- .../build-a-backend/functions/add-lambda-layers/index.mdx | 6 ++++++ .../build-a-backend/functions/configure-functions/index.mdx | 6 ++++++ .../build-a-backend/functions/custom-functions/index.mdx | 6 ++++++ .../functions/environment-variables-and-secrets/index.mdx | 6 ++++++ .../functions/scheduling-functions/index.mdx | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/src/pages/[platform]/build-a-backend/functions/add-lambda-layers/index.mdx b/src/pages/[platform]/build-a-backend/functions/add-lambda-layers/index.mdx index 12d2dcceb1a..fba4b3c0629 100644 --- a/src/pages/[platform]/build-a-backend/functions/add-lambda-layers/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/add-lambda-layers/index.mdx @@ -31,6 +31,12 @@ export function getStaticProps() { Amplify offers the ability to add layers to your functions which contain your library dependencies. Lambda layers allow you to separate your function code from its dependencies, enabling easier management of shared components across multiple functions and reducing deployment package sizes. + + +**Note:** Configuring or adding layers in `defineFunction` is not supported for [Custom Functions](/[platform]/build-a-backend/functions/custom-functions/). + + + To add a Lambda layer to your function, follow these steps: 1. First, create and set up your Lambda layer in AWS. You can do this through the AWS Console or using the AWS CLI. For guidance on creating layers, refer to the [AWS documentation on creating Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-create). diff --git a/src/pages/[platform]/build-a-backend/functions/configure-functions/index.mdx b/src/pages/[platform]/build-a-backend/functions/configure-functions/index.mdx index 1bd7aa2163b..7119bfd46da 100644 --- a/src/pages/[platform]/build-a-backend/functions/configure-functions/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/configure-functions/index.mdx @@ -32,6 +32,12 @@ export function getStaticProps() { `defineFunction` comes out-of-the-box with sensible but minimal defaults. The following options are provided to tweak the function configuration. + + +**Note:** The following options are not supported for [Custom Functions](/[platform]/build-a-backend/functions/custom-functions/) except for `resourceGroupName`. + + + ## `name` By default, functions are named based on the directory the `defineFunction` call is placed in. In the above example, defining the function in `amplify/functions/my-demo-function/resource.ts` will cause the function to be named `my-demo-function` by default. diff --git a/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx b/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx index caf7792f488..5f90d50c5fb 100644 --- a/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/custom-functions/index.mdx @@ -38,6 +38,12 @@ AWS Amplify Gen 2 functions are AWS Lambda functions that can be used to perform + + +**Note:** [Environment variables and secrets](/[platform]/build-a-backend/functions/environment-variables-and-secrets/), [scheduling configuration](/[platform]/build-a-backend/functions/scheduling-functions/), [lambda layers](/[platform]/build-a-backend/functions/add-lambda-layers/) and [functions-options](/[platform]/build-a-backend/functions/configure-functions/) in `defineFunction` are not supported for Custom Functions. You can specify these configurations directly in your CDK Function definition. + + + In this guide, you will learn how to create Python and Go functions with Amplify functions. The examples shown in this guide do not use Docker to build functions. Instead, the examples use commands that run on your host system to build, and as such require the necessary tooling for the language you are using for your functions. ## Python diff --git a/src/pages/[platform]/build-a-backend/functions/environment-variables-and-secrets/index.mdx b/src/pages/[platform]/build-a-backend/functions/environment-variables-and-secrets/index.mdx index 9aee5c77cd6..0aeaa35dc7a 100644 --- a/src/pages/[platform]/build-a-backend/functions/environment-variables-and-secrets/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/environment-variables-and-secrets/index.mdx @@ -37,6 +37,12 @@ Amplify Functions support setting environment variables and secrets on the `envi + + +**Note:** Environment variables and secrets configuration in `defineFunction` is not supported for [Custom Functions](/[platform]/build-a-backend/functions/custom-functions/). + + + ## Environment variables Environment variables can be configured in `defineFunction` using the `environment` property. diff --git a/src/pages/[platform]/build-a-backend/functions/scheduling-functions/index.mdx b/src/pages/[platform]/build-a-backend/functions/scheduling-functions/index.mdx index 0a95051d2ec..9b62e5e7211 100644 --- a/src/pages/[platform]/build-a-backend/functions/scheduling-functions/index.mdx +++ b/src/pages/[platform]/build-a-backend/functions/scheduling-functions/index.mdx @@ -31,6 +31,12 @@ export function getStaticProps() { Amplify offers the ability to schedule Functions to run on specific intervals using natural language or [cron expressions](https://en.wikipedia.org/wiki/Cron). To get started, specify the `schedule` property in `defineFunction`: + + +**Note:** Configuring the schedule in `defineFunction` is not supported for [Custom Functions](/[platform]/build-a-backend/functions/custom-functions/). + + + ```ts title="amplify/jobs/weekly-digest/resource.ts" import { defineFunction } from "@aws-amplify/backend";