Setup Squid Proxy in AWS with Chef and CloudFormation

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives the steps to use a project I created to spin up a small Squid EC2 Instance to use for Proxying network traffic from a private network that does not have internet access. This is good for if we would like to keep the private systems off the internet, but allow a small whitelist for DevOps Automation. Such, as AWS APIs (CFN-Init, SES, SNS, Lambda, Route53, etc.), Github, Chef domain for installing Client, Rubygems.org, npmjs.org etc. The project is a combination of AWS CloudFormation and Chef Cookbooks on Github.


Prerequisites

  • Public and Private subnet in VPC


Github Project

https://github.com/bonusbits/bonusbits_awsapi_proxy


Use CloudFormation Template to Create EC2 Instance, Install and Configure Squid Proxy Service

Option 1 (Use Launcher Link)

  1. Login to AWS Web Console
  2. Select Region
  3. Click the Following Button
    AWS Access Proxy CloudFormation Template
  4. Fill out the parameters for your environment
  5. Select Next, Next, Create


Option 2 (CFN Launcher CLI Tool)

HowTo:Use CloudFormation Launcher CLI Tool


Option 3 (AWS CLI)

Icon-Tip-Square-Green.png Create a customized parameters JSON file and feed the answer file into the AWS CLI. An example can be found at https://github.com/bonusbits/bonusbits_awsapi_proxy/tree/master/aws/example-parameters.json


Option 4 (Download Project)

Primarily this is the way to go if we wish to customize the project.

  1. Clone the git repo locally
    git clone https://github.com/bonusbits/bonusbits_awsapi_proxy.git
    
  2. Use Test Kitchen or CloudFormation


Related Articles