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
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 keys2. Describe the desired state
A least-privilege S3 read policy as Terraform.
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.
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-1Want 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.