Skip to content

CICD-261 · AWS CLI authentication ​

Encyclopedia · Cloud infrastructure integration · All snippets

Previous · CICD-260 · Next · CICD-262

1. Where it fits ​

  • Placement .github/workflows/aws.yml step.
  • Prerequisites provider CLI, scoped CI identity, test environment and provider configuration for named resource.
  • Platforms github-actions.

2. Copy the snippet ​

yaml
uses: aws-actions/configure-aws-credentials@v4
with:
  role-to-assume: ${{ vars.AWS_DEPLOY_ROLE }}
  aws-region: eu-west-2

3. How it works ​

This invokes an action at step scope or a reusable workflow at job scope. The reference and declared inputs must match that contract.

4. Verify the result ​

Requires id-token: write and a role trust condition bound to the repository and environment. Verify caller identity without printing credentials.

Validation syntax-validated (YAML parse). Status definitions.