← All insightsAutomation

Automating Amazon Web Services from scratch

CodeWizard Academy · 12 January 2026 · 3 min read · Intermediate

Anything you do to Amazon Web Services twice should be automated. This walks the path from a manual install to a repeatable, pipeline-driven setup.

1. Install it reproducibly

bash
curl 'https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip' -o awscli.zip
unzip awscli.zip && sudo ./aws/install
aws configure sso   # prefer SSO over long-lived keys

2. Describe the desired state

A least-privilege S3 read policy as Terraform.

hcl
data "aws_iam_policy_document" "read_assets" {
  statement {
    actions   = ["s3:GetObject"]
    resources = ["arn:aws:s3:::acme-assets/*"]
  }
}
resource "aws_iam_policy" "read_assets" {
  name   = "read-assets"
  policy = data.aws_iam_policy_document.read_assets.json
}

3. Run it from CI

Authenticate from CI with OIDC, not stored keys.

yaml
permissions: { id-token: write, contents: read }
steps:
  - uses: aws-actions/configure-aws-credentials@v4
    with:
      role-to-assume: arn:aws:iam::1234:role/ci
      aws-region: eu-west-1

Want senior help putting Amazon Web Services to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult