Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow role chaining for configuring aws credentials #73

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ integrations:
role:
plan: arn:aws:iam::yyyyyyyyyyyy:role/cptest-core-gbl-identity-gitops
apply: arn:aws:iam::yyyyyyyyyyyy:role/cptest-core-gbl-identity-gitops
aws-role-chaining: false
matrix:
sort-by: .stack_slug
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
Expand Down
1 change: 1 addition & 0 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ usage: |-
role:
plan: arn:aws:iam::yyyyyyyyyyyy:role/cptest-core-gbl-identity-gitops
apply: arn:aws:iam::yyyyyyyyyyyy:role/cptest-core-gbl-identity-gitops
aws-role-chaining: false
matrix:
sort-by: .stack_slug
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ runs:
echo "terraform-state-table=$(atmos describe config -f json | jq -r '.integrations.github.gitops["artifact-storage"].table')" >> $GITHUB_OUTPUT
echo "terraform-state-bucket=$(atmos describe config -f json | jq -r '.integrations.github.gitops["artifact-storage"].bucket')" >> $GITHUB_OUTPUT
echo "terraform-plan-role=$(atmos describe config -f json | jq -r '.integrations.github.gitops.role.plan')" >> $GITHUB_OUTPUT
echo "aws-role-chaining=$(atmos describe config -f json | jq -r '.integrations.github.gitops."aws-role-chaining" == true')" >> $GITHUB_OUTPUT

- name: Install Terraform
if: ${{ steps.config.outputs.terraform-version != '' && steps.config.outputs.terraform-version != 'null' }}
Expand Down Expand Up @@ -194,6 +195,7 @@ runs:
role-to-assume: ${{ steps.config.outputs.terraform-plan-role }}
role-session-name: "atmos-terraform-plan-gitops"
mask-aws-account-id: "no"
role-chaining: ${{ steps.config.outputs.aws-role-chaining }}

- name: Atmos Terraform Plan
if: ${{ steps.atmos-github-actions-enabled.outputs.value == 'true' }}
Expand Down Expand Up @@ -278,6 +280,8 @@ runs:
role-to-assume: ${{ steps.config.outputs.terraform-state-role }}
role-session-name: "atmos-terraform-state-gitops"
mask-aws-account-id: "no"
role-chaining: ${{ steps.config.outputs.aws-role-chaining }}
unset-current-credentials: ${{ steps.config.outputs.aws-role-chaining }}

- name: Store New Plan
if: ${{ steps.atmos-plan.outputs.error == 'false' }}
Expand Down