Skip to content

caseconsulting/devsetup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS CONFIGURATION

  1. Create User
  2. Create Security Group
  3. Update Security Group
  4. Create Key Pair
  5. Setup Client
  6. Launch Development Instance
  7. Verify
  8. Create Elastic IP
  9. Configure Host Workstation

Create User

If a user does not already exist for you, get an administrator to create one for you with associated IAM policies that allow you to launch EC2 instances

Create Security Group

In AWS console, go to EC2 console

Click on Security Groups

If 'Intern Dev SG' exists, then skip to next section

  • Press 'Create Security Group' button
    • Security group name: 'Intern Dev SG'
    • Description: 'Intern Dev SG'
    • VPC:
    • Security group rules:
      • Inbound:
        • SSH - TCP - 22 - Custom IP ()
        • RDP - TCP - 3389 - Custom IP ()
      • Outbound:

Note: if you are behind a router, the inbound will CIDR will have to be that of your router.

Update Security Group

If the Security Group does exist, add the CIDR for your laptop

  • Select 'Intern Dev SG' button
    • Add Security group rules (do NOT delete any others!)
      • Inbound:
        • SSH - TCP - 22 - Custom IP ()
        • RDP - TCP - 3389 - Custom IP ()
      • Outbound:

Create Key Pair

  1. In AWS console, go to EC2 console
  2. Click on Key Pairs
  3. If a key pair already exists for you, then skip to next section
  4. Create a new key pair with your name (e.g., _keypair)
  5. The private key (e.g., _keypair.pem) will automatically download to your workstation

Setup Client

On Windows

  1. Open PuTTYgen (e.g., C:\Program Files (x86)\PuTTY\puttygen.exe)
  2. Load your private key PEM file (HINT: Change file viewer to show All Files)
  3. Enter and confirm Key passphrase (optional)
  4. Under Type of key to generate, select SSH-2 RSA
  5. Click on Save private key and save private key file (e.g., _keypair.ppk)
  6. Exit PuTTYgen
  7. Open Pageant (e.g., "C:\Program Files (x86)\PuTTY\pageant.exe")
  8. Click on Add Key
  9. Select private key file (e.g., _keypair.ppk)
  10. Close Pageant (it is still running in background)
  11. To run Pageant when you login to Windows:
    • Create Pageant shortcut in Windows Startup folder
    • Change shortcut target to include private key, like the following:
      • "C:\Program Files (x86)\PuTTY\pageant.exe" C:\Users\Administrator\credentials\<yourname>_keypair.ppk

For more details, see: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

On Mac

  1. Copy your key to ~/.ssh
  2. chmod chmod the key to 600

To ssh to the instance:

ssh -i ~/.ssh/<keyname> centos@<hostname>

Or, set up your ssh config file.

Host ec2dev
  Hostname <hostname>
  User centos
  IdentityFile /Users/<user>/.ssh/<user>.pem
  ForwardX11 yes
  ForwardX11Trusted yes

Via safari

Open Safari

(haven't gotten above to work yet) From what I have read it is supposed to works

in the url type:

vnc://<ec2 instance hostname>

For more details, see: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html


Launch Development Instance

  1. Launch new EC2 instance to serve as CentOS 7 development workstation
  2. Click "Launch Instance" from the EC2 console
  3. Select "AWS Marketplace"
  4. Search "CentOS 7"
  5. Choose "CentOS 7 (x86_64) with Updates HVM"
  6. Select "t2.medium"
  7. Select "Next Configure Instance Details"
  8. Keep Defaults except:
    • Subnet: "subnet-818b73c9"
    • Auto-assign Public IP: "Enabled"
    • Advanced Details:
      • Copy Contents of userdata.yml into User Data or use the userdata file uploader
    • Configure Instance Details
  9. Select "Add Storage"
    • Add a new Volume with the following:
      • Volume Type: EBS
      • Device: /dev/sdb - this is important. Userdata will look for this device.
      • Size: 20GB
      • Volume Type: General Purpose SSD
      • Delete On Termination: Check
  10. Select "Add Tags"
    • Add Tags
      • Name: <your name> Dev
      • Application: Intern Dev
      • Schedule: Daily
  11. Select "Configure Security Groups"
    • Check 'Select an exiting security group'
    • Select 'Intern Dev SG'
  12. Select 'Review and Launch'
  13. Review your entries
  14. Select 'Launch'
  15. Select your key pair

Verify

After the instance launches, ssh to it:

MAC

ssh -vv -i <key> centos@<hostname>

Tail /var/log/cloud-init-output.log and make sure that it completes successfully

Create Elastic IP

(Optional)

  1. In AWS console, go to EC2 console
  2. Click on Elastic IPs
  3. Press "Allocate New Address" button
  4. Select new Elastic IP
  5. Choose Actions - Associate Address
  6. Click in the Instance field, select the EC2 instance that you just launched, and then press "Associate" button

Configure Host Workstation

Once dev workstation is up and running (i.e., green for Instance State and Status Checks), you can login and verify the server built correctly.

Login

Using PuTTY, login to dev workstation as 'centos' user if you are on windows

Review Cloud-init Output

cloud-init (i.e., user-data) execution is logged to /var/log/cloud-init-output.log sudo more /var/log/cloud-init-output.log

Set Password For centos User

sudo -i
passwd centos
<enter new password>
<verify new password>
exit

Set VNC Password

vncpasswd
<enter same password>
<verify same password>

Reload VNC Server

sudo systemctl daemon-reload
sudo systemctl start vncserver@:1.service
sudo systemctl enable vncserver@:1.service

Set Up Git

git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
git config --global color.ui auto
git config --global push.default simple
git config --global user.name <YOUR_FIRST_NAME>
git config --global user.email <YOUR_EMAIL>

Login To Dev Instance Using RDP

Open Windows Remote Desktop Connection (mstsc.exe)

Press 'Show Options' to expand settings

Keep the default settings, except the following:

  1. General
    • Computer: Public DNS for EC2 instance
    • Username: centos
  2. Display
    • Colors: True Color (24 bit)
  3. Experience
    • Connection speed: LAN (10 Mbps or higher)
    • Font smoothing: checked
  4. Click 'Save As' to save this configuration to you Desktop
  5. Press 'Connect' button

If warning is displayed about identity of remote computer, then check "Don't ask me again for connections to this computer" and press "Yes" button. Login as 'centos' user with password you set for 'centos' user (Xfce only) When welcomed to first start of panel, choose "Use default config"


Configure Window Manager

Xfce

(1) Google Chrome

  1. Right-click on Desktop and select "Create Launcher..."
  2. In Name field, enter Chrome
  3. As you type, system will pop-up a recommendation for Google Chrome
  4. Select recommended option for Google Chrome
  5. Press "Create" button
  6. From the desktop, click on newly created Google Chrome launcher
  7. When "Untrusted application launcher" appears, press "Mark Executable" button
  8. When prompted, leave box checked to "Make Google Chrome the default browser" and
  9. press "OK" button.
  10. Close Google Chrome
  11. Right-click on Google Chrome icon on desktop and choose
  12. 'Open With "Create Launcher on the panel"' option.
  13. From "Add New Item", select "Panel 1" and press "Add" button
    • This adds icon to top-right corner of screen
  14. From "Add New Item", select "Panel 2" and press "Add" button
    • This adds icon to bottom-middle of screen

(2) Mozilla Firefox

  1. Right-click on Desktop and select "Create Launcher..."
  2. In Name field, enter Firefox
  3. As you type, system will pop-up a recommendation for Firefox
  4. Select recommended option for Firefox
  5. Press "Create" button
  6. From the desktop, click on newly created Firefox Web Browser launcher
  7. When "Untrusted application launcher" appears, press "Mark Executable" button
  8. For "Import settings and data", select "Don't import anything" and press "Next"
  9. Close Firefox
  10. Right-click on Firefox Web Browser icon on desktop and choose
  11. 'Open With "Create Launcher on the panel"' option.
  12. From "Add New Item", select "Panel 1" and press "Add" button
    • This adds icon to top-right corner of screen
  13. From "Add New Item", select "Panel 2" and press "Add" button
    • This adds icon to bottom-middle of screen

(3) Atom

  1. Right-click on Desktop and select "Create Launcher..."
  2. In Name field, enter Atom
  3. As you type, system will pop-up a recommendation for Atom
  4. Select recommended option for Atom
  5. Press "Create" button
  6. From the desktop, click on newly created Atom launcher
  7. When "Untrusted application launcher" appears, press "Mark Executable" button
  8. Close Atom
  9. Right-click on Atom icon on desktop and choose
  10. 'Open With "Create Launcher on the panel"' option.
  11. From "Add New Item", select "Panel 1" and press "Add" button
    • This adds icon to top-right corner of screen
  12. From "Add New Item", select "Panel 2" and press "Add" button
    • This adds icon to bottom-middle of screen

(4) Clean Up Panels

From panel at bottom-middle of screen, right-click on generic Web Browser icon and select "Remove" option.

Mate

(1) Google Chrome

  1. In top left-corner, click on Applications and expand Internet
  2. Right-click on Google Chrome and select "Add this launcher to panel"
  3. In top left-corner, click on Applications and expand Internet
  4. Right-click on Google Chrome and select "Add this launcher to desktop"
  5. From the desktop, click on newly created Google Chrome launcher
  6. When prompted, leave box checked to "Make Google Chrome the default browser" and press "OK" button.
  7. Close Google Chrome

(2) Mozilla Firefox

  1. In top left-corner, click on Applications and expand Internet
  2. Right-click on Firefox Web Browser and select "Add this launcher to desktop"
  3. From the desktop, click on newly created Firefox Web Browser launcher
  4. For "Import settings and data", select "Don't import anything" and press "Next"
  5. Close Firefox

(3) Atom

  1. In top left-corner, click on Applications and expand Programming
  2. Right-click on Atom and select "Add this launcher to panel"
  3. In top left-corner, click on Applications and expand Programming
  4. Right-click on Atom and select "Add this launcher to desktop"
  5. From the desktop, click on newly created Atom launcher
  6. Close Atom

Configure dotFiles

Clone the dotFiles repo and follow instructions in readme.txt.

Upgrade Installed Packages

  sudo yum -y update
  #  Leave out the -y option so you have an opportunity to decide if you want to install updates or not
  sudo yum clean all

Fix Frozen DEV Instance

If RDP session ever freezes (most likely due to no available memory), SSH to dev workstation (using PuTTY) and stop VNC server and xrdp processes

sudo systemctl stop vncserver@:1.service
sudo systemctl stop xrdp

Releases

No releases published

Packages

No packages published

Languages