From 37d2ca804c34da3e1b2464cc0f7588fd77f88ea2 Mon Sep 17 00:00:00 2001 From: Pratapa Lakshmi Date: Sun, 21 Jul 2024 18:47:20 +0530 Subject: [PATCH] update github actions to assume role --- .github/workflows/packer-build-ami.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/packer-build-ami.yml b/.github/workflows/packer-build-ami.yml index 36c03b356..4782ca96a 100644 --- a/.github/workflows/packer-build-ami.yml +++ b/.github/workflows/packer-build-ami.yml @@ -15,13 +15,15 @@ jobs: steps: - name: Checkout to Git uses: actions/checkout@v2 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} + + - name: Assume Role + uses: ./ + env: + ROLE_ARN: ${{ secrets.AWS_PACKER_ROLE }} + ROLE_SESSION_NAME: packersession + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + DURATION_SECONDS: 900 - name: Setup `packer` uses: hashicorp/setup-packer@main