Skip to content

Commit

Permalink
feature/PI-43-stored-properties created per account dev and adjusted …
Browse files Browse the repository at this point in the history
…variable names
  • Loading branch information
Rohoolio committed Oct 23, 2023
1 parent a8f31b3 commit 8a9b6d4
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/actions/terraform/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ inputs:
required: false
default: ""
parameter-deploy:
description: "If account wide parameter deploy then specify 'parameter-deploy'"
description: "If account wide parameter deploy then specify 'parameter_deploy'"
required: false
default: ""
runs:
using: "composite"
steps:
- uses: ./.github/actions/make/
with:
command: terraform--${{ inputs.command }} TERRAFORM_WORKSPACE="${{ inputs.workspace }}" TERRAFORM_ACCOUNT_WIDE="${{ inputs.account-wide }} PARAMETER_DEPLOY="${{ inputs.parameter_deploy }}"
command: terraform--${{ inputs.command }} TERRAFORM_WORKSPACE="${{ inputs.workspace }}" TERRAFORM_ACCOUNT_WIDE="${{ inputs.account-wide }}" PARAMETER_DEPLOY="${{ inputs.parameter_deploy }}"
requires-aws: true
cache-suffix: ${{ inputs.cache-suffix }}
8 changes: 8 additions & 0 deletions .github/workflows/_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
required: false
type: string
default: ""
account_wide:
required: false
type: string
default: ""

permissions:
id-token: write
Expand All @@ -20,6 +24,7 @@ env:
WORKSPACE: ${{ inputs.workspace }}
CACHE_NAME: ${{ inputs.workspace }}-cache
PARAMETER_DEPLOY: ${{ inputs.parameter_deploy }}
ACCOUNT_WIDE: ${{ inputs.account_wide }}
# SLACK_WEBHOOK_URL: ${{ secrets.DEPLOY_ENV_SLACK_HOOK_URL }}

jobs:
Expand Down Expand Up @@ -69,6 +74,7 @@ jobs:
with:
command: init
workspace: ${{ env.WORKSPACE }}
account_wide: ${{ env.ACCOUNT_WIDE }}
parameter_deploy: ${{ env.PARAMETER_DEPLOY }}

terraform--plan:
Expand All @@ -82,6 +88,7 @@ jobs:
with:
command: plan
workspace: ${{ env.WORKSPACE }}
account_wide: ${{ env.ACCOUNT_WIDE }}
parameter_deploy: ${{ env.PARAMETER_DEPLOY }}

terraform--apply:
Expand All @@ -95,6 +102,7 @@ jobs:
with:
command: apply
workspace: ${{ env.WORKSPACE }}
account_wide: ${{ env.ACCOUNT_WIDE }}
parameter_deploy: ${{ env.PARAMETER_DEPLOY }}

test--smoke:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-parameters-nonprod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
uses: ./.github/workflows/_deploy.yml
with:
workspace: ${{ inputs.workspace }}
parameter_deploy: "parameter-deploy"
parameter_deploy: "parameter_deploy"
account_wide: "account_wide"
secrets: inherit # pragma: allowlist secret
3 changes: 2 additions & 1 deletion .github/workflows/deploy-parameters-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ jobs:
uses: ./.github/workflows/_deploy.yml
with:
workspace: prod
parameter_deploy: "parameter-deploy"
parameter_deploy: "parameter_deploy"
account_wide: "account_wide"
secrets: inherit # pragma: allowlist secret
4 changes: 2 additions & 2 deletions scripts/infrastructure/terraform/terraform-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ function _get_terraform_dir() {
local dir=$(pwd)
if [ "$RUNNING_IN_CI" = 1 ]; then
echo "${dir}/infrastructure/terraform/per_workspace"
elif [ "$parameter_deploy" = "parameter-deploy"] && ["$account_wide" = "account_wide"]; then
echo "${dir}/infrastructure/terraform/per_account/parameters"
elif [ "$parameter_deploy" = "parameter_deploy"] && ["$account_wide" = "account_wide"]; then
echo "${dir}/infrastructure/terraform/per_account/$env/parameters"
elif [ "$account_wide" = "account_wide" ]; then
echo "${dir}/infrastructure/terraform/per_account/$env"
elif [ "$account_wide" = "non_account_wide" ]; then
Expand Down

0 comments on commit 8a9b6d4

Please sign in to comment.