Skip to content

Commit

Permalink
added tags map support in dsf_poc_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
roiklorin committed Oct 13, 2024
1 parent ec03d1f commit 831f8bb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/dsf_poc_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
explicit_ref:
required: true
type: string
additional_tags:
required: true
type: string
default: '{"OwnerEmail": "ex1", "ManagerEmail": "ex2", "TeamEmail": "ex3", "Description": "ex4", "Environment": "ex5", "DataClassification": "ex6"}'
secrets:
AWS_ACCESS_KEY_ID:
required: true
Expand All @@ -31,6 +35,11 @@ on:
type: boolean
default: false
required: false
additional_tags:
required: true
type: string
default: '{"OwnerEmail": "ex1", "ManagerEmail": "ex2", "TeamEmail": "ex3", "Description": "ex4", "Environment": "ex5", "DataClassification": "ex6"}'


push:
branches:
Expand Down Expand Up @@ -63,6 +72,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DESTROY_DELAY_SECONDS: 1800
TF_VAR_additional_tags: ${{ fromJson(inputs.additional_tags) }}

permissions:
contents: read
Expand Down Expand Up @@ -205,14 +215,14 @@ jobs:
- name: Terraform Plan
run: |
terraform -chdir=$EXAMPLE_DIR workspace list
terraform -chdir=$EXAMPLE_DIR plan -var dam_license=license.mprv
terraform -chdir=$EXAMPLE_DIR plan -var dam_license=license.mprv -var additional_tags='${{ env.TF_VAR_additional_tags }}'
# On push to "main", build or change infrastructure according to Terraform configuration files
# Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks
- name: Terraform Apply
id: apply
# if: github.ref == 'refs/heads/"master"' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: terraform -chdir=$EXAMPLE_DIR apply -var dam_license=license.mprv -auto-approve
run: terraform -chdir=$EXAMPLE_DIR apply -var dam_license=license.mprv -var additional_tags='${{ env.TF_VAR_additional_tags }}' -auto-approve

- name: Terraform Output
if: always()
Expand Down

0 comments on commit 831f8bb

Please sign in to comment.