How swoodford/aws works
Project type and purpose
• This is an open-source command-line toolkit, composed of standalone Bash scripts that automate AWS operations via the AWS CLI and jq.
• Its purpose is to simplify, standardize, and batch common DevOps tasks across multiple AWS services (EC2, S3, CloudFront, CloudWatch, VPC, WAF, Route53, IAM, Elastic Beanstalk, etc.).
File structure
• Top-level scripts (.sh) are grouped by AWS service (e.g., cloudfront-*.sh, ec2-*.sh, s3-*.sh, vpc-*.sh, waf-*.sh, route53-*.sh, iam-*.sh, elastic-beanstalk-*.sh, cloudwatch-*.sh).
• “docs/” and “.github/” contain project governance, contribution, CI, and issue templates.
• Configuration for continuous integration is in .travis.yml.
README for additional insights
• The README enumerates each script, its function, and the AWS service it targets.
• It specifies prerequisites: a POSIX shell, AWS CLI (Python), and jq.
• It highlights cross-region and cross-account compatibility.
Main components
a. User Environment
• Developer’s machine (macOS/Linux) with Bash shell.
• Local installations: AWS CLI, jq, optional s3cmd, terraform if needed.
b. Project Repository & CI/CD
• GitHub repository (source code host).
• Travis CI (build & lint scripts, run equality_test.sh, enforce coding standards).
c. Script Modules (Logical grouping)
• CloudFront module
• CloudWatch module
• EC2 module
• S3 module
• VPC module
• WAF module
• IAM module
• Route53 module
• Elastic Beanstalk module
• “Other Tools” module (e.g., convert-iplist-cidr-json-array.sh, install-awscli.sh)
d. CLI Abstraction Layer
• AWS CLI (aws)
• jq (JSON parsing)
e. AWS Service Endpoints
• Individual AWS service APIs called by the AWS CLI: S3, EC2, CloudFront, CloudWatch, VPC, WAF, IAM, Route53, Elastic Beanstalk
f. External Dependencies
• Optional third-party tools (cli53 for Route53 exports, s3cmd for S3 backups)
Relationships and interactions
• User invokes a Bash script → script parses arguments, calls AWS CLI and/or jq → AWS CLI issues HTTPS requests to AWS service endpoints → AWS services process requests and return JSON responses → script uses jq to parse and output results.
• CI/CD pipeline (Travis CI) pulls code from GitHub → runs linting/tests (e.g., equality_test.sh) → validates scripts.
Architectural patterns and principles
• Layered architecture:
• Presentation layer = Bash scripts (UI)
• Logic layer = calls to AWS CLI + jq processing
• Service layer = AWS APIs
• Modularity: each script handles a single concern or AWS service function.
• Idempotence and repeatability: scripts are safe to run multiple times, designed for automation.
• Extensibility: new scripts or service modules can be added without affecting existing ones.
Details to capture
• Scripts into logical service-based modules.
• Prerequisites on the developer machine (Python, AWS CLI, jq).
• GitHub repo and CI pipeline: code pushed → Travis CI tests → status reported on GitHub.