Please complete RDS Database Setup first, as it takes a while for a database to spin up.
On the same page in the “Advanced Details” section, add the following script to the user data:
#!/bin/bash
yum update -y
rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
yum install dotnet-sdk-3.0 -y
cat > /tmp/subscript.sh << EOF
# START
echo "Setting up NodeJS Environment"
curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
echo 'export NVM_DIR="/home/ec2-user/.nvm"' >> /home/ec2-user/.bashrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> /home/ec2-user/.bashrc
# Dot source the files to ensure that variables are available within the current shell
. /home/ec2-user/.nvm/nvm.sh
. /home/ec2-user/.bashrc
# Install NVM, NPM, Node.JS & Grunt
nvm install v12.7.0
# Install Amazon Templates and Tools
dotnet new -i Amazon.Lambda.Templates
dotnet tool install -g Amazon.Lambda.Tools
dotnet tool install -g Amazon.ECS.Tools
dotnet add package System.Data.SqlClient --version 4.8.0-preview1.19504.10
dotnet add package AWSSDK.SecretsManager --version 3.3.101.37
EOF
chown ec2-user:ec2-user /tmp/subscript.sh && chmod a+x /tmp/subscript.sh
sleep 1; su - ec2-user -c "/tmp/subscript.sh"
All the other settings can remain with default settings. click “Next: Add Storage”
We don’t need to change any of the storage settings. click “Next: Add Tags”
Add a tag with:
Click “Next: Configure Security Group”
On “Step 6: Configure Security Group”, Change:
Click “Review and Launch”. This will take you back to the Ec2 instances page.
The “Select an existingkey pair or create a new key pair” dialog will pop up. In the drop down select “Proceed without a key pair” and check the “I acknowledge…” box.
Click “Launch Instance.”
Select the “Cloud9 Development Machine” instance and review the content in the “Description” tab.
Make note of the “IPv4 Public IP”. We will need it in the next steps.
Once the connection is established, open the “~/.ssh/authorized_keys” file with nano directory
nano ~/.ssh/authorized_keys
Go back to the Cloud9 tab and and click “Copy key to clipboard”
Paste the key into the “authorized_keys” file on the line below the existing entry.
Save (Ctrl+O and then enter) and exist the file (ctrl+X)
Close the the broswer tab that has the connection to Ec2.
Go to the Cloud9 tab. Click “Next Step.”
On “Review” page, click “Create Environment.”
The Cloud9 installer will ask if it is ok to install some dependencies. Click “Next”, and “Next” again.
It will ask if you want to install “C development tool”, type “y” and hit enter.
After those tools are installed, Click “Next” and then click “Finish”
The Cloud9 IDE will load in this tab.
Congratulations, you the development environment is ready.