Skip to content

Instantly share code, notes, and snippets.

@pictolearn
Created May 17, 2019 08:15
Show Gist options
  • Save pictolearn/5b027bb2a5a0f676dbfdd8548e5af3ae to your computer and use it in GitHub Desktop.
Save pictolearn/5b027bb2a5a0f676dbfdd8548e5af3ae to your computer and use it in GitHub Desktop.
Change_EC2_USER_DATA
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"
## Add Stuff below if you are looking to change user-data
#!/bin/bash
##Note the below commands may need to be run as a sudo depending on the OS you are using.
# Updates the OPERATING SYSTEM
yum update -y
# Install EPEL, required for NGINX, note you would typically do a yum install -y epel-release but in case of
# AWS Linux you will need to do the following
amazon-linux-extras install epel -y
# Install NGINX
yum install -y nginx
#Starting NGINX
systemctl start nginx
systemctl enable nginx
--//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment