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

Added INT deployment using s3 backend #98

Merged
merged 1 commit into from
Oct 18, 2023
Merged
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
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
Loading