# Upgrading to AWS Linux 2 on Elastic Beanstalk environment

**URL:** <https://community.parseplatform.org/t/upgrading-to-aws-linux-2-on-elastic-beanstalk-environment/2834>\
**Category:** Parse Server 📡\
**Created:** [August 7, 2022, 8:51pm UTC](https://community.parseplatform.org/t/upgrading-to-aws-linux-2-on-elastic-beanstalk-environment/2834 "2022-08-07T20:51:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![santiagoprieto](https://community.parseplatform.org/user_avatar/community.parseplatform.org/santiagoprieto/32/1264_2.png) [@santiagoprieto](https://community.parseplatform.org/u/santiagoprieto)\
**Post date:** [August 7, 2022, 8:51pm UTC](https://community.parseplatform.org/t/upgrading-to-aws-linux-2-on-elastic-beanstalk-environment/2834/1 "2022-08-07T20:51:15Z")

</div>

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](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.migration-al.html?icmpid=docs_elasticbeanstalk_console) I see that something needs to change from `.ebextensions` to `.platform` but I don’t know what file or where. [This AWS guide](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html) 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:

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

```

install-bower.sh

```auto
#!/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

```auto
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

```auto
packages:
  yum:
    git: []

```
