Upgrading to AWS Linux 2 on Elastic Beanstalk environment

I’ve tried a few ways to best upgrade a Parse Server from Amazon Linux 1 to 2 on an Elastic Beanstalk environment but had no luck so far. My parse-server is configured pretty vanilla.

Could you share your config?

Based on this AWS guide I see that something needs to change from .ebextensions to .platform but I don’t know what file or where. This AWS guide has an example source bundle but with no details.

The parse-server-example doesn’t yet seem to have an upgrade for this case.

My .ebextensions have this structure and below is the code for each file:

.ebextensions
   `-- bin
      `-- install-bower.sh
   `-- 00_change_npm_permissions.config
   `-- app.config

install-bower.sh

#!/bin/bash

hash_file="/tmp/nodejshash"

check_if_npm_packages_has_to_be_installed () {
    if [ -f $hash_file ]; then
        check_if_same_hash
    else
        return 0
    fi
}

check_if_same_hash () {
    hash_new="$(md5sum .ebextensions/bin/install-nodejs.sh 2> /dev/null | cut -d ' ' -f 1)"
    hash_current="$(cat "$hash_file" 2> /dev/null | cut -d ' ' -f 1)"

    if [ $hash_new == $hash_current ]; then
        return 1
    else
        return 0
    fi
}

install_node () {
    if hash nodejs 2> /dev/null; then
        echo 'nodejs install, add more processing if needed' > /dev/null
    else
        curl -sL https://rpm.nodesource.com/setup | bash -
        yum install -y nodejs-1.4.28
    fi
}

install_npm_packages () {
    npm install -g bower
}

update_current_hash () {
    echo $hash_new > $hash_file
}

install_node

if check_if_npm_packages_has_to_be_installed; then
    install_npm_packages
    update_current_hash
fi

00_change_npm_permissions.config

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/00_set_tmp_permissions.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash
      chown -R nodejs:nodejs /tmp/.npm

app.config

packages:
  yum:
    git: []