From be1d847c0fb79e7f7fb29e2d94dfe24d69d9cea1 Mon Sep 17 00:00:00 2001 From: heyethereum Date: Mon, 17 Jun 2024 21:41:02 +0800 Subject: [PATCH] test iam sts assume role --- .github/workflows/workflow.yml | 15 +++++++++++++++ .gitignore | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c7ccb9e..dea2a5e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,6 +4,10 @@ on: push: branches: [ "main" ] +permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + jobs: build: @@ -31,3 +35,14 @@ jobs: - name: Build with Maven run: mvn -B package --file pom.xml + - name: Configure AWS Credentials + id: configure-aws-credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get Instance ID + id: get_instance_id + run: aws ssm start-session --target i-0fc1eb77776dc1758 + diff --git a/.gitignore b/.gitignore index 6d77e55..8a409ed 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ target/ *.iws *.iml *.ipr -application-local.properties +src/main/resources/application-local.properties ### NetBeans ### /nbproject/private/