2023-02-21 06:47:14 -05:00
|
|
|
name: Delete IAM configuration
|
|
|
|
description: Delete previously created IAM configuration.
|
|
|
|
|
2023-04-12 07:24:13 -04:00
|
|
|
inputs:
|
|
|
|
cloudProvider:
|
2023-04-27 08:03:49 -04:00
|
|
|
description: "Either 'aws', 'azure' or 'gcp'."
|
|
|
|
required: true
|
2023-04-12 07:24:13 -04:00
|
|
|
gcpServiceAccount:
|
2023-04-27 08:03:49 -04:00
|
|
|
description: "GCP service account to use for authentication."
|
|
|
|
required: false
|
2023-04-12 07:24:13 -04:00
|
|
|
azureCredentials:
|
2023-04-27 08:03:49 -04:00
|
|
|
description: "Azure service principal to use for authentication."
|
|
|
|
required: false
|
2023-04-12 07:24:13 -04:00
|
|
|
|
2023-02-21 06:47:14 -05:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2023-04-12 07:24:13 -04:00
|
|
|
- name: Login to GCP (IAM service account)
|
|
|
|
if: inputs.cloudProvider == 'gcp'
|
|
|
|
uses: ./.github/actions/login_gcp
|
|
|
|
with:
|
|
|
|
service_account: ${{ inputs.gcpServiceAccount }}
|
|
|
|
|
|
|
|
- name: Login to AWS (IAM role)
|
|
|
|
if: inputs.cloudProvider == 'aws'
|
2023-10-26 02:18:37 -04:00
|
|
|
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
|
2023-04-12 07:24:13 -04:00
|
|
|
with:
|
|
|
|
role-to-assume: arn:aws:iam::795746500882:role/GithubActionsE2EIAM
|
|
|
|
aws-region: eu-central-1
|
|
|
|
# extend token expiry to 6 hours to ensure constellation can terminate
|
|
|
|
role-duration-seconds: 21600
|
|
|
|
|
|
|
|
- name: Login to Azure (IAM service principal)
|
|
|
|
if: inputs.cloudProvider == 'azure'
|
|
|
|
uses: ./.github/actions/login_azure
|
|
|
|
with:
|
|
|
|
azure_credentials: ${{ inputs.azureCredentials }}
|
|
|
|
|
2023-02-21 06:47:14 -05:00
|
|
|
- name: Delete IAM configuration
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-08-16 05:34:58 -04:00
|
|
|
constellation iam destroy --yes --tf-log=DEBUG
|