Deploy Backend Infrastructure

  1. Install pulumi:

    curl -fsSL https://get.pulumi.com | sh
    export PATH=$PATH:/home/ec2-user/.pulumi/bin
    export PULUMI_CONFIG_PASSPHRASE=
    pulumi login --local
    

    press ENTER when prompted.

  2. Install dependencies:

    cd ~/environment/parsectix-chatbot-workshop/backend-infrastructure
    npm install
    
  3. Run the following command to create the backend infrastructure

    pulumi up -s $WORKSPACE-backend
    

    select and click yes when prompted. It will take a couple of minutes until all resources have been created.

    BackendPreview

  4. Copy the API url of the generated stack because we will need it in the next steps. (We can choose to add this step in a build script and hide it from the user)

    BackendStackOutput

    export BACKEND_API_URL=$(pulumi stack output -s "$WORKSPACE-backend" apiUrl -C ~/environment/parsectix-chatbot-workshop/backend-infrastructure)
    export BUCKET_NAME=$(pulumi stack output -s "$WORKSPACE-backend" bucketName -C ~/environment/parsectix-chatbot-workshop/backend-infrastructure)
    

In case a new terminal tab is opened in Cloud9 the environment variables must be exported again.

You have now successfully created the backend of the chatbot application. That includes an API Gateway, an AWS Lambda, a Kendra Index with the corresponding Data source and the necessary S3 bucket. You can proceed to the next step.

BackendDeployed