Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

DCB Admin must be deployed with AWS Amplify, a fast and modern AWS solution that uses CloudFront proxying by default. The steps to deploy DCB Admin on AWS Amplify are outlined below.

Getting started

  1. Sign into the AWS management console and open the AWS Amplify console for your organisation. You should see a page with the title ‘All apps’.

  2. For your first time, you will need to create an Amplify application. To do this, select ‘New app’, and then select ‘Host web app’.

  3. On the next page, select GitLab as your repository provider, and click ‘Continue’.

  4. On the ‘Add repository branch’ page, select the dcb-admin-ui repository. You will then be prompted to select a branch. Knowledge Integration will have provided you with the name of the branch to choose: please select this branch and continue.

  5. In the IAM Role section, choose ‘Create and use a new service role’ to allow Amplify to automatically create a service role for you.

    1. If you have a previously created service role that you want to use instead, select that option.

  6. Choose ‘Next’, and then click ‘Save and deploy’.

For more information, please refer to the relevant AWS Amplify docs.

Setting up environment variables

  1. To set up the necessary environment variables for DCB Admin, you must navigate to ‘App settings’ and then to ‘Environment variables’.

  2. Enter the environment variables from the file you have been provided with: some are deployment-specific (see the example table below)

  3. You will then need to modify the Amplify build specification file amplify.yml to make these variables accessible to Next.js. This can be found under ‘App build specification’ in ‘Build settings’. Simply click ‘Edit’ and add these lines under build: commands:

        - env | grep -e DCB_ >> .env.production
        - env | grep -e KEYCLOAK_ >> .env.production
        - env | grep -e NEXTAUTH_ >> .env.production
        - env | grep -e DISCOVERY_SCAFFOLD_URL >> .env.production
  1. Save your changes and redeploy your application - go to ‘All apps', click on your deployment and select ‘redeploy this version’.

For more information please refer to the official documentation.

Example environment variables

DCB_API_BASE

URL of your DCB deployment

DCB_ES_URL

https://reshare-dcb-uat-es.sph.k-int.com/mobius-si

DISCOVERY_SCAFFOLD_URL

URL of your discovery scaffold

KEYCLOAK_ID

dcb

KEYCLOAK_ISSUER

https://keycloak.sph.k-int.com/realms/dcb-hub

KEYCLOAK_REFRESH

https://keycloak.sph.k-int.com/realms/dcb-hub

KEYCLOAK_SECRET

UX0mIH71CEbRNk3RWim0L6lmmHlTQ9MH

NEXTAUTH_SECRET

jkdhfkjsahfdjkhsdkjf73

NEXTAUTH_URL

URL of your deployment

Common errors and how to solve them

  • If you encounter the following error (or similar) when deploying DCB Admin, there is a simple fix: CustomerError: It looks like you are attempting to deploy a Next.js SSR app, but your app's framework looks wrong. Please update your app's framework to 'Next.js - SSR' to ensure that your app is deployed correctly.

    • Solution: Run the following command in CloudShell. This will update the framework manually:

      • aws amplify update-branch --app-id <value> --branch-name <value> --framework 'Next.js - SSR'

      • The value of app-id can be found under ‘App ARN’ in App settings → General. It is the value at the end of the ARN (highlighted in the screenshot)

        image-20240314-142025.png
  • If you encounter an error connecting to the repository, please contact Knowledge Integration.

  • Amplify docs can be found here https://docs.aws.amazon.com/amplify/latest/userguide/welcome.html

  • No labels