https://github.com/australianbiocommons/squid-aws-proxy

https://github.com/australianbiocommons/squid-aws-proxy

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: AustralianBioCommons
  • Language: TypeScript
  • Default Branch: main
  • Size: 69.3 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created about 2 years ago · Last pushed 10 months ago
Metadata Files
Readme

README.md

🦑 Squid AWS Proxy – CDK Deployment

This AWS CDK application deploys a Squid proxy layer on EC2 with Auto Scaling, route table automation via Lambda, CloudWatch monitoring, and optional GitHub-based CI/CD using CodePipeline.


📁 Project Structure

. ├── bin/ │ └── deploy.ts # CDK entrypoint ├── lib/ │ ├── build-env-config.ts # Local env config │ ├── pipeline-stack.ts # CodePipeline definition │ ├── pipeline-stage.ts # Deployable CDK stage │ ├── squid-aws-proxy-stack.ts # Squid infrastructure stack │ ├── squid-asg-construct.ts # ASG + S3 config + user data │ ├── squid-lambda-construct.ts # Lambda for route updates │ ├── squid-monitoring-construct.ts # CW metrics/alarms/SNS │ └── iam.ts # IAM policies helper ├── assets/ │ ├── config_files/ # squid.conf, whitelist, etc. │ ├── user_data/ # EC2 bootstrap script │ └── lambda/ # Python Lambda code └── cdk.json


Deployment

Prerequisites

  • AWS CDK v2
  • AWS CLI configured
  • IAM credentials with access to EC2, S3, Lambda, SNS, SSM, CloudWatch, CodePipeline

Option 1: Deploy With CodePipeline

bash cdk deploy --context targetEnv=uat --context deployWithoutPipeline=false

Required SSM Parameters:

  • /gen3/squid-environments – JSON string with env configs
  • /gen3/github-connection-arn – GitHub CodePipeline connection ARN

Option 2: Direct Deployment (No Pipeline)

bash cdk deploy --context targetEnv=uat --context deployWithoutPipeline=true

Uses lib/build-env-config.ts instead of SSM.


Deployed Resources

🟢 Squid EC2 Auto Scaling Groups

  • One Squid instance per AZ in public subnets
  • IAM role for CloudWatch, SSM, EC2 control
  • User data installs and configures Squid
  • Config pulled from S3 bucket
  • Subnet route table IDs tagged onto each ASG

📊 CloudWatch Monitoring

  • Metric: procstat_cpu_usage from Squid process
  • One alarm per ASG instance
  • Alarms trigger on 0% CPU (missing heartbeat)
  • Sends ALARM and OK to squid-asg-alarm-topic (SNS)

🛠 Lambda Function

  • Subscribed to SNS alarm topic
  • When an instance becomes healthy:
    • Updates route table in target subnets
    • Ensures traffic uses healthy Squid proxy

🔁 CodePipeline (Optional)

  • Synth, build, and deploy stages per environment
  • Manual approvals for staging and prod
  • GitHub integrated via AWS CodeStar connection

🧰 Example build-env-config.ts

ts export const BuildEnv = { dev: { aws: { account: "123456789012", region: "ap-southeast-2" }, vpcId: "vpc-abc12345", proxiedSubnets: [ "subnet-aaa11111", "subnet-bbb22222" ] }, uat: { aws: { account: "123456789012", region: "ap-southeast-2" }, vpcId: "vpc-def67890", proxiedSubnets: [ "subnet-ccc33333", "subnet-ddd44444" ] } };


🔐 Example SSM Parameter (/gen3/squid-environments)

Set this as a String in AWS SSM Parameter Store:

json { "dev": { "aws": { "account": "123456789012", "region": "ap-southeast-2" }, "vpcId": "vpc-abc12345", "proxiedSubnets": ["subnet-aaa11111", "subnet-bbb22222"] }, "uat": { "aws": { "account": "123456789012", "region": "ap-southeast-2" }, "vpcId": "vpc-def67890", "proxiedSubnets": ["subnet-ccc33333", "subnet-ddd44444"] } }


✅ Commands Summary

Direct deployment

bash cdk deploy --context targetEnv=dev --context deployWithoutPipeline=true

Deploy via pipeline

bash cdk deploy --context targetEnv=dev --context deployWithoutPipeline=false


📄 License

MIT

Owner

  • Name: AustralianBioCommons
  • Login: AustralianBioCommons
  • Kind: organization
  • Email: systems@biocommons.org.au

Documentation for the development, deployment and/or optimisation of key community-endorsed bioinformatics tools and workflows

GitHub Events

Total
  • Delete event: 2
  • Push event: 6
  • Pull request event: 5
  • Create event: 2
Last Year
  • Delete event: 2
  • Push event: 6
  • Pull request event: 5
  • Create event: 2

Dependencies

package-lock.json npm
  • 409 dependencies
package.json npm
  • @types/jest ^29.5.12 development
  • @types/node 20.11.16 development
  • aws-cdk ^2.1003.0 development
  • jest ^29.7.0 development
  • ts-jest ^29.1.2 development
  • ts-node ^10.9.2 development
  • typescript ~5.3.3 development
  • @aws-sdk/client-ssm ^3.759.0
  • aws-cdk-lib ^2.183.0
  • constructs ^10.4.2
  • source-map-support ^0.5.21