amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

Completely custom pipeline without any Amplify wrappers or images

Open OperationalFallacy opened this issue 8 months ago • 2 comments

Before opening, please confirm:

Amplify Hosting feature

Deployments

Is your feature request related to a problem? Please describe:

Can Amplify team publish a guide how to deploy resources without using any Amplify-forced build configurations or services?

This will allow customers to setup pipeline the way it works for our environments.

There are three main parts, backend deployment, outputs export and the front-end deployment. The most problematic part is front-end deployments due to magical transfers of build output somewhere on CDN.

Describe how you'd like this feature to work

I'd like to have CDK construct on top of the Pipelines

so I can run just one command to deploy pipeline and be able to adjust it as needed without constantly required to mess with build settings in the console, deal with custom docker images, custom yml files and curl hacks

npx cdk deploy amplifyApp-main/prod/pipeline

The pipeline will build and deploy my dev env and optionally can proceed to deploy other environments.

Thank you

OperationalFallacy avatar May 17 '25 14:05 OperationalFallacy

This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!

github-actions[bot] avatar May 17 '25 14:05 github-actions[bot]

Can you please explain or point me to the docs on how the front-end deployments work on your platform?

I figured out the cdk backend part but the front-end deployments remains a total magic. What happens with artifacts folder after yarn build --prod?

I'd like to understand so I can move the build to properly defined CDK pipelines.

version: 1
backend:
  phases:
    preBuild:
      commands:
        - nvm install 22
        - nvm use 22
        - echo "Build environment is $CODEBUILD_BUILD_IMAGE"
    build:
      commands:
        - cd backend
        - corepack prepare
        - corepack enable
        - yarn --version
        - yarn install --immutable
        - npx cdk deploy --ci --all --hotswap --method=direct --output .amplify/artifacts/cdk.out --context amplify-backend-namespace=$AWS_APP_ID --context amplify-backend-name=$AWS_BRANCH --require-approval never --context amplify-backend-type=branch
        - npx ampx generate outputs --branch $AWS_BRANCH --out-dir amplify --app-id $AWS_APP_ID
        - cd ..
    cache:
      paths:
        - backend/.yarn/**/*
        - backend/node_modules/**/*
        - /root/.nvm/.cache
frontend:
  phases:
    build:
      commands:
        - cd website
        - corepack prepare
        - corepack enable
        - yarn install --immutable
        - yarn build --prod
  artifacts:
    baseDirectory: website/out
    files:
      - "**/*"
  cache:
    paths:
      - website/.yarn/**/*
      - website/node_modules/**/*
      - website/.next/cache/**/*

OperationalFallacy avatar May 31 '25 23:05 OperationalFallacy