Skip to content

Commit 4fb83ba

Browse files
Added AWS credentials via Github OIDC
1 parent 7a8f395 commit 4fb83ba

File tree

5 files changed

+41
-17
lines changed

5 files changed

+41
-17
lines changed

.github/workflows/healthcheck-app-existingVpc-Ubuntu-Thurs.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
workflow_dispatch:
77
schedule:
88
- cron: '0 15 * * 4'
9+
permissions:
10+
id-token: write
11+
contents: read
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -16,6 +19,12 @@ jobs:
1619
uses: actions/setup-python@v4
1720
with:
1821
python-version: '3.13'
22+
- name: Configure AWS credentials via OIDC
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
role-to-assume: ${{ secrets.oidc_role_arn }}
26+
aws-region: us-east-1
27+
role-duration-seconds: 7200
1928
- name: Install dependencies
2029
run: |
2130
python -m pip install --upgrade pip
@@ -31,7 +40,4 @@ jobs:
3140
- name: MATLAB Web App Server Reference Architecture Health Check Test Ubuntu Existing VPC Ubuntu us-east-1 region
3241
run: |
3342
cd healthcheck
34-
export AWS_ACCESS_KEY_ID=${{ secrets.aws_access_key_id }}
35-
export AWS_SECRET_ACCESS_KEY=${{ secrets.aws_secret_access_key }}
36-
export AWS_REGION="us-east-1"
37-
python test_mwasrefarch_healthcheck_newvpc.py ${{ secrets.KeyPairName }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "us-east-1" "Ubuntu"
43+
python test_mwasrefarch_healthcheck_newvpc.py ${{ secrets.OIDCKeyPairNameVirginia }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "us-east-1" "Ubuntu"

.github/workflows/healthcheck-app-existingVpc-Win-Tue.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
workflow_dispatch:
77
schedule:
88
- cron: '0 15 * * 2'
9+
permissions:
10+
id-token: write
11+
contents: read
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -16,6 +19,12 @@ jobs:
1619
uses: actions/setup-python@v4
1720
with:
1821
python-version: '3.13'
22+
- name: Configure AWS credentials via OIDC
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
role-to-assume: ${{ secrets.oidc_role_arn }}
26+
aws-region: eu-west-1
27+
role-duration-seconds: 7200
1928
- name: Install dependencies
2029
run: |
2130
python -m pip install --upgrade pip
@@ -31,7 +40,4 @@ jobs:
3140
- name: MATLAB Web App Server Reference Architecture Health Check Test Windows Existing VPC Windows eu-west-1 region
3241
run: |
3342
cd healthcheck
34-
export AWS_ACCESS_KEY_ID=${{ secrets.aws_access_key_id }}
35-
export AWS_SECRET_ACCESS_KEY=${{ secrets.aws_secret_access_key }}
36-
export AWS_REGION="eu-west-1"
37-
python test_webappserver_refarch_existingvpc.py ${{ secrets.KeyPairNameIreland }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "eu-west-1" "Windows"
43+
python test_webappserver_refarch_existingvpc.py ${{ secrets.OIDCKeyPairNameIreland }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "eu-west-1" "Windows"

.github/workflows/healthcheck-app-newVpc-Ubuntu-Mon.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
push:
99
schedule:
1010
- cron: '0 15 * * 1'
11+
permissions:
12+
id-token: write
13+
contents: read
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest
@@ -18,6 +21,12 @@ jobs:
1821
uses: actions/setup-python@v4
1922
with:
2023
python-version: '3.13'
24+
- name: Configure AWS credentials via OIDC
25+
uses: aws-actions/configure-aws-credentials@v4
26+
with:
27+
role-to-assume: ${{ secrets.oidc_role_arn }}
28+
aws-region: us-east-1
29+
role-duration-seconds: 7200
2130
- name: Install dependencies
2231
run: |
2332
python -m pip install --upgrade pip
@@ -33,7 +42,4 @@ jobs:
3342
- name: MATLAB Web App Server Reference Architecture Health Check Test Ubuntu New VPC Ubuntu us-east-1 region
3443
run: |
3544
cd healthcheck
36-
export AWS_ACCESS_KEY_ID=${{ secrets.aws_access_key_id }}
37-
export AWS_SECRET_ACCESS_KEY=${{ secrets.aws_secret_access_key }}
38-
export AWS_REGION="us-east-1"
39-
python test_mwasrefarch_healthcheck_newvpc.py ${{ secrets.KeyPairName }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "us-east-1" "Ubuntu"
45+
python test_mwasrefarch_healthcheck_newvpc.py ${{ secrets.OIDCKeyPairNameVirginia }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "us-east-1" "Ubuntu"

.github/workflows/healthcheck-app-newVpc-Win-Wed.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
workflow_dispatch:
77
schedule:
88
- cron: '0 15 * * 3'
9+
permissions:
10+
id-token: write
11+
contents: read
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -16,6 +19,12 @@ jobs:
1619
uses: actions/setup-python@v4
1720
with:
1821
python-version: '3.13'
22+
- name: Configure AWS credentials via OIDC
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
role-to-assume: ${{ secrets.oidc_role_arn }}
26+
aws-region: ap-northeast-1
27+
role-duration-seconds: 7200
1928
- name: Install dependencies
2029
run: |
2130
python -m pip install --upgrade pip
@@ -31,7 +40,4 @@ jobs:
3140
- name: MATLAB Web App Server Reference Architecture Health Check Test Windows New VPC Windows ap-northeast region
3241
run: |
3342
cd healthcheck
34-
export AWS_ACCESS_KEY_ID=${{ secrets.aws_access_key_id }}
35-
export AWS_SECRET_ACCESS_KEY=${{ secrets.aws_secret_access_key }}
36-
export AWS_REGION="ap-northeast-1"
37-
python test_mwasrefarch_healthcheck_newvpc.py ${{ secrets.KeyPairNameTokyo }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "ap-northeast-1" "Windows"
43+
python test_mwasrefarch_healthcheck_newvpc.py ${{ secrets.OIDCKeyPairNameTokyo }} ${{ secrets.lmpassword }} ${{ secrets.ipaddress }} "ap-northeast-1" "Windows"

healthcheck/refarch_testtools/deploy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from botocore.exceptions import WaiterError
66

77
_logger = logging.getLogger("deploy")
8-
8+
logging.basicConfig(level=logging.INFO)
99

1010
def deploy_stack(template_url, template_parameters, region, stack_base_name="refArchTest", extra_parameters={}):
1111
stack_name = _create_stack_name(stack_base_name)

0 commit comments

Comments
 (0)