Skip to content

Commit d60ced3

Browse files
feat(api): FTRS-856 Initial Checkin of Index
1 parent 535d5ce commit d60ced3

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/deploy-open-search-indexes.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
echo "inputs.domain='${{ inputs.domain }}' does not look like an owner/repo; skipping checkout"
5252
shell: bash
5353

54-
- name: Debug: show inputs and check workspace/files
54+
- name: "Debug: show inputs and check workspace/files"
5555
run: |
5656
echo "DEBUG: workflow inputs"
5757
echo " environment='${{ inputs.environment }}'"
@@ -81,12 +81,26 @@ jobs:
8181
fi
8282
shell: bash
8383

84-
- name: Configure AWS Credentials
85-
uses: NHSDigital/uec-dos-management/.github/actions/configure-credentials@latest
84+
- name: Configure AWS Credentials (assume role if available)
85+
if: ${{ secrets.AWS_ROLE_ARN != '' }}
86+
uses: aws-actions/configure-aws-credentials@v2
8687
with:
87-
aws_account_id: ${{ secrets.ACCOUNT_ID }}
88-
aws_region: ${{ vars.AWS_REGION }}
89-
type: ${{ inputs.type }}
88+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
89+
aws-region: ${{ vars.AWS_REGION }}
90+
91+
- name: Configure AWS Credentials (fallback to access keys if role not provided)
92+
if: ${{ secrets.AWS_ROLE_ARN == '' && secrets.AWS_ACCESS_KEY_ID != '' }}
93+
uses: aws-actions/configure-aws-credentials@v2
94+
with:
95+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
96+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
97+
aws-region: ${{ vars.AWS_REGION }}
98+
99+
- name: Validate AWS credentials
100+
run: |
101+
echo "Validating AWS credentials and region"
102+
aws sts get-caller-identity --output json
103+
shell: bash
90104

91105
- name: Install awscurl (for SigV4 signing)
92106
run: |

0 commit comments

Comments
 (0)