diff --git a/.github/workflows/cicd-demo.yml b/.github/workflows/cicd-demo.yml index 83052c0..0cff299 100644 --- a/.github/workflows/cicd-demo.yml +++ b/.github/workflows/cicd-demo.yml @@ -8,8 +8,10 @@ env: AWS_REGION: us-east-1 # set this to your preferred AWS region, e.g. us-west-1 +# Permission can be added at job level or workflow level permissions: - contents: read + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout jobs: deploy: @@ -19,12 +21,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + - name: configure aws credentials + uses: aws-actions/configure-aws-credentials@v4.0.2 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-to-assume: ${{ vars.ACTION_EXECUTE_IAM_ROLE_ARN }} + role-session-name: GitHub_to_AWS_via_FederatedOIDC aws-region: ${{ env.AWS_REGION }} + + # Hello from AWS: WhoAmI + - name: Sts GetCallerIdentity + run: | + aws sts get-caller-identity - name: Install agent-evaluation run: |