Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated May 16, 2024

Modify Amplify-generated Lambda resources with CDK

Amplify Functions utilize the NodejsFunction construct from the AWS Cloud Development Kit (CDK). The underlying resources can be modified, overridden, or extended using CDK after setting the resource on your backend.

amplify/backend.ts
import { defineBackend } from '@aws-amplify/backend';
import { myFunction } from './functions/my-function';
const backend = defineBackend({
myFunction
})
// CDK constructs can be accessed via
backend.myFunction.resources
// where the Lambda function can be found on
backend.myFunction.resources.lambda

The Lambda resource available is a representation of IFunction.

Adding IAM Policies

To learn how to add IAM policies to a Function's execution role, visit the documentation for granting access to other resources.