Skip to content

Commit

Permalink
Merge pull request #98 from vivid-cpreston/feature/wfdm894
Browse files Browse the repository at this point in the history
Added INT deployment using s3 backend
  • Loading branch information
vivid-cpreston authored Oct 18, 2023
2 parents d83cada + 895ceb8 commit 71b8d7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/deploy_int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ jobs:
openssl sha256 staging/wfdm-file-index-initializer* > staging/wfdm-file-index-initializer-hash.txt
openssl sha256 staging/wfdm-opensearch-indexing* > staging/wfdm-opensearch-indexing-hash.txt
- uses: shallwefootball/s3-upload-action@master
name: Upload S3
id: S3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: wfdm-s3-bucket-${{ env.TARGET_ENV }}
source_dir: staging
destination_dir: ''
role-to-assume: ${{ secrets.AWS_TERRAFORM_ROLE_TO_ASSUME }}
role-session-name: wfdm-terraform
aws-region: ca-central-1

- name: Upload S3
id: S3
run:
aws s3 cp ./staging s3://wfdm-s3-bucket-int --recursive

# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
Expand Down
16 changes: 6 additions & 10 deletions terragrunt/INT/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@ generate "backend" {
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
backend "remote" {
organization = "wf1-wfdm-opensearch"
workspaces {
name = "nr-bcws-opensearch"
}
backend "s3" {
bucket = "wfdm-terraform-remote-state-int"
key = "wfdm-opensearch-statefile-int"
region = "ca-central-1"
dynamodb_table = "wfdm-remote-state-lock-int"
encrypt = true
}
}
EOF
}

remote_state {
backend = "remote"
config = { }
}

generate "inputs" {
path = "terraform.auto.tfvars"
if_exists = "overwrite_terragrunt"
Expand Down

0 comments on commit 71b8d7c

Please sign in to comment.