Amazon Elastic Compute Cloud (EC2) is a virtual server that can be scaled up and down to meet app traffic demands. This tutorial walks through the steps to configure and launch AWS EC2 Instance.
To complete this tutorial, you need register a free account with AWS (the AWS Free-Tier gives you access to AWS’s basic services, which are sufficient to complete this tutorial), and Pipelines. Save your login credentials as you will need them for this tutorial.
Amazon EC2 uses public–key cryptography to encrypt and decrypt login information and we will have to create a Key Pair to log into our instance.
chmod 400 youKeyName.pem
Security Group is a traffic control layer to your instance. You can specify which IP address is welcome for a particular protocal. For example, HTTP and SSH.
We are now ready to launch our EC2 instance. There are only a few steps left until your EC2 instance is up and running and ready for code to be deployed!
To make sure you have successfully launched your instance, navigate to the left pane of the EC2 page, and click on Instances. Check out Instance State, and make sure that it is running. You will need your instance IP address to connect to your instance. Your instance IP address can be found in the instance’s details. Refer to the image below:
With your running instance, let’s connect to your it using SSH.
ssh -i "YOUR_KEY_PAIR_NAME.pem" ec2-user@YOUR_INSTANCE_IP_ADDRESS
sudo apt-get update
Congratulations, you now have access your server!
The Pipelines agent facilitates the auto deploy process. Install the Pipelines agent with the following command:
To install on Linux or macOS X you can use either curl or wget with one of the following syntaxes.
wget -qO- https://pipelines.puppet.com/download/client | sh
curl -sSL https://pipelines.puppet.com/download/client | sh
To install on Windows, copy and paste the following PowerShell command into a command (cmd) window.
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://pipelines.puppet.com/download/client.ps1'))" & SET PATH=%PATH%;%ProgramFiles%/Distelli
After downloading the agent, you must run the install command to install the agent. To do so use the
agent install command.
Note: This installation requires root (administrator) permissions.
jdoe@ServerB:~$ <b>wget -qO- https://pipelines.puppet.com/download/client | sh</b> This script requires superuser privileges to install packages Please enter your password at the sudo prompt [sudo] password for jdoe: Installing Distelli CLI 3.55 for architecture 'Linux-x86_64'... Downloading https://s3.amazonaws.com/download.distelli.com/distelli.Linux-x86_64/distelli.Linux-x86_64-3.55.gz To install the agent, run: sudo /usr/local/bin/distelli agent install jdoe@ServerB:~$ <b>sudo /usr/local/bin/distelli agent install</b> Distelli Email: <b>firstname.lastname@example.org</b> Password: 1: User: jdoe 2: Team: janedoe/teamjane Team : <b>1</b> Server Info: https://www.distelli.com/jdoe/servers/d0c4b300-9fcf-2846-ba90-080027c8277c Starting upstart daemon with name: dtk-supervise-cc1233c06f7ad94a8d34ac610381242f9ae28bb8 jdoe@ServerB:~$
To validate the agent is installed and working use the
agent status command.
/usr/local/bin/distelli agent status Distelli Agent (serverA) is Running with id 766b88c8-e925-11e4-ae8b-080027cc07f7
You installed the Pipelines agent to your server. The agent will allow Pipelines to communicate with your server, and facilitate the auto deploy process. Let’s add the server to Pipelines.
Note: You can save this EC2 instance as an Amazon Machine Image. This will allow you to launch identical EC2 instances without going through the entire set up process.
Now that our AWS EC2 Instance is launched and the Pipelines agent is installed on our server, we are now ready to deploy our application. See the Deployment tutorials section for information on deployments.