Skip to content

Commit

Permalink
Move role and region to env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Jun 17, 2024
1 parent a8c322f commit 4876245
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/actions/build_ami/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ inputs:
description: Save the AMIs as a build artifact.
required: false
default: "false"
uid2_aws_role:
description: The AWS role to assume for UID2
required: true
uid2_aws_region:
description: The UID2 AWS region to upload AMI to
required: true
euid_aws_role:
description: The AWS role to assume for EUID
required: true
euid_aws_region:
description: The EUID AWS region to upload AMI to
required: true

outputs:
version_number:
Expand Down Expand Up @@ -84,15 +96,15 @@ runs:
uses: aws-actions/configure-aws-credentials@v4
if: ${{ inputs.identity_scope == 'uid2' }}
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::475720075663:role/github-runner-operator-runner
aws-region: ${{ inputs.uid2_aws_region }}
role-to-assume: ${{ inputs.uid2_aws_role }}

- name: Configure EUID AWS credentials
uses: aws-actions/configure-aws-credentials@v4
if: ${{ inputs.identity_scope == 'euid' }}
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::618285103646:role/github-runner-operator-runner
aws-region: ${{ inputs.euid_aws_region }}
role-to-assume: ${{ inputs.euid_aws_role }}

- name: Show AWS Identity
shell: bash
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/build-uid2-ami.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
env:
REPO_OWNER: IABTechLab
REPO_NAME: uid2-operator
UID2_AWS_ROLE: arn:aws:iam::475720075663:role/github-runner-operator-runner
UID2_AWS_REGION: us-east-2
EUID_AWS_ROLE: arn:aws:iam::618285103646:role/github-runner-operator-runner
EUID_AWS_REGION: eu-central-1

jobs:
buildUID2:
Expand Down Expand Up @@ -57,6 +61,10 @@ jobs:
operator_run_number: ${{ inputs.operator_run_number }}
operator_branch: ${{ inputs.operator_branch }}
save_ami: ${{ inputs.save_ami }}
uid2_aws_role: ${{ env.UID2_AWS_ROLE }}
uid2_aws_region: ${{ env.UID2_AWS_REGION }}
euid_aws_role: ${{ env.EUID_AWS_ROLE }}
euid_aws_region: ${{ env.EUID_AWS_REGION }}

buildEUID:
name: EUID Operator AMI
Expand Down Expand Up @@ -91,6 +99,10 @@ jobs:
operator_run_number: ${{ inputs.operator_run_number }}
operator_branch: ${{ inputs.operator_branch }}
save_ami: ${{ inputs.save_ami }}
uid2_aws_role: ${{ env.UID2_AWS_ROLE }}
uid2_aws_region: ${{ env.UID2_AWS_REGION }}
euid_aws_role: ${{ env.EUID_AWS_ROLE }}
euid_aws_region: ${{ env.EUID_AWS_REGION }}

collectAllArtifacts:
name: Collect All Artifacts
Expand Down

0 comments on commit 4876245

Please sign in to comment.