Search code examples
aws-amplifyaws-cdk

How can I specify a branch folder of a monorepo when deploying an Amplify app using the CDK?


Currently using the aws console is simple: add repo folder using aws console

But I can't find the way to do it using the CDK.


Solution

  • this can be added with the environement variable: AMPLIFY_MONOREPO_APP_ROOT

    https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html

    AMPLIFY_MONOREPO_APP_ROOT

    The path to use to specify the app root of a monorepo app, relative to the root of your repository.

    apps/react-app

    The AMPLIFY_MONOREPO_APP_ROOT environment variable must have the same value as the appRoot key inside the build spec. –