Trying to automate startup steps on AWS with userdata

Keywords: MEAN - AWS - Technical issue - Other
bnsupport ID: 1a23a913-448c-0a4d-abd8-2469ec059e18
Description:
The following data has been added to user data of aws instance for bitnami mean ec2 instance. The problem happens at npm install part. May i know how this can be done in a right way.

Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
–//
Content-Type: text/cloud-config; charset=“us-ascii”
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=“cloud-config.txt”
#cloud-config
cloud_final_modules:

  • [scripts-user, always]
    –//
    Content-Type: text/x-shellscript; charset=“us-ascii”
    MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=“userdata.txt”
    #!/bin/bash
    /bin/echo “Hello World” >> /tmp/testfile.txt
    /bin/echo “Hello it’s snowing and no one caring, World from $(date) $(hostname -f)” > /home/bitnami/htdocs/index.html
    cd /home/bitnami
    git clone https://github.com/simransindhwani/docker-trial2.git
    cd docker-trial2
    cd taskZero
    su bitnami
    /opt/bitnami/node/lib/node_modules/npm install >> /tmp/node-front.txt
    cd …
    cd backend
    su bitnami
    /opt/bitnami/node/lib/node_modules/npm install >> /tmp/node-back.txt
    –//

Thanks in advance

Hi @sasidhar666p,

Can you explain what you are trying to achieve? I’m afraid the topic exceeds the scope of this forum, which is for issues related to the ( supported ) configuration of Bitnami stacks.

Regards,
Michiel