Interview Prep/Python for DevOps/boto3 & AWS automation

Why should automation never use long-lived access keys in CI?

IntermediateConceptboto3 & AWS automation
Answer

Static keys leak through logs, forks, laptops and old pipelines, never expire, and are hard to attribute. Instead:

  • GitHub Actions/GitLab: OIDC federation to an IAM role (aws-actions/configure-aws-credentials with role-to-assume), with the trust policy restricted to a repo and branch.
  • EC2: instance profiles. EKS: IRSA or Pod Identity. ECS: task roles. Lambda: execution role.
  • Humans: IAM Identity Center (SSO) with aws sso login.

boto3 picks all of these up through the default chain without code changes.

All Python for DevOps questions Roadmap: Python for automation

More on boto3 & AWS automation