Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
72aa2bf
Refactoring to use opentofu instead of terraform.
juliareynolds-nava Sep 17, 2025
34752bd
Correct uses
juliareynolds-nava Sep 17, 2025
468ac05
Correct uses
juliareynolds-nava Sep 17, 2025
1eb827a
Correct terraform commands
juliareynolds-nava Sep 17, 2025
341bc41
fix terraform directory
juliareynolds-nava Sep 18, 2025
5fa95bf
fix terraform directory
juliareynolds-nava Sep 18, 2025
8ca15b7
fix terraform directory
juliareynolds-nava Sep 18, 2025
765ec76
Merge branch 'main' into plt-1340_opentofu
juliareynolds-nava Sep 18, 2025
21a4cd9
PR feedback
juliareynolds-nava Sep 22, 2025
192de13
Update .github/workflows/deploy-all.yml
juliareynolds-nava Sep 22, 2025
e497c4f
Update .github/workflows/deploy-all.yml
juliareynolds-nava Sep 22, 2025
eb89724
Merge branch 'main' into plt-1340_opentofu
juliareynolds-nava Sep 22, 2025
6e71e06
PR feedback
juliareynolds-nava Sep 22, 2025
e83dedc
Update .github/workflows/deploy-all.yml
juliareynolds-nava Sep 23, 2025
8165380
Update .github/workflows/deploy-all.yml
juliareynolds-nava Sep 23, 2025
a1f7940
Refactoring to use opentofu instead of terraform.
juliareynolds-nava Sep 17, 2025
310dd54
Correct uses
juliareynolds-nava Sep 17, 2025
ca39eac
Correct uses
juliareynolds-nava Sep 17, 2025
3708a8f
Correct terraform commands
juliareynolds-nava Sep 17, 2025
751ac97
fix terraform directory
juliareynolds-nava Sep 18, 2025
28cc9c2
fix terraform directory
juliareynolds-nava Sep 18, 2025
1d7c156
fix terraform directory
juliareynolds-nava Sep 18, 2025
e73b735
PR feedback
juliareynolds-nava Sep 22, 2025
b9142e7
Update .github/workflows/deploy-all.yml
juliareynolds-nava Sep 22, 2025
f21ad51
Update .github/workflows/deploy-all.yml
juliareynolds-nava Sep 22, 2025
b293e55
PR feedback
juliareynolds-nava Sep 22, 2025
5dd1739
PR feedback
juliareynolds-nava Sep 23, 2025
a719d00
remove cd
juliareynolds-nava Sep 23, 2025
19480f0
PR feedback
juliareynolds-nava Sep 23, 2025
66bd4bb
Fix step names on cosign and tenv installs
gsf Sep 24, 2025
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
interval: "daily"
open-pull-requests-limit: 0

- package-ecosystem: "terraform"
- package-ecosystem: "terraform" # Works for both Terraform and OpenTofu
directory: "/"
schedule:
interval: "daily"
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/deploy-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,31 +157,32 @@ jobs:
echo "BCDA_AMI=$BCDA_AMI" >> $GITHUB_ENV
export WORKER_AMI=`aws ec2 describe-images --region ${{ vars.AWS_REGION }} --filters 'Name=tag:app,Values=bcda-worker' 'Name=tag:version,Values=${{ env.RELEASE_VERSION }}' --query 'Images[*][CreationDate,ImageId] | reverse(sort_by(@,&[0])) | [0][1]' --output text`
echo "WORKER_AMI=$WORKER_AMI" >> $GITHUB_ENV
- name: Install terraform
- name: Install Opentofu
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
with:
directory: ./terraform
uses: cmsgov/cdap/actions/setup-tfenv-terraform@main
- name: Init, Plan Terraform
- uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should look like this:

      - name: Install Cosign to verify OpenTofu install
        uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
      - name: Install OpenTofu
        uses: cmsgov/cdap/actions/setup-tenv@8343fb96563ce4b74c4dececee9b268f42bd4a40

- name: Init, Plan OpenTofu
run: |
IFS=":@" read -r -a STRS <<< ${{ env.DATABASE_URL }}
export APP_DB_PW=${STRS[2]}
cd terraform/${{ env.RELEASE_ENV }}
touch bcda-release-api-worker-vars.tfvars
export TF_CLI_ARGS="-no-color"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These -no-color args can be dropped here and in the next step. Unlike Jenkins, GHA can handle color output.

terraform init
terraform plan \
tofu init
tofu plan \
-var 'env=${{ env.RELEASE_ENV }}' \
-var 'ami_id=${{ env.BCDA_AMI }}' \
-var 'worker_ami_id=${{ env.WORKER_AMI }}' \
-var 'instance_type=${{ vars.INSTANCE_CLASS }}' \
-var-file=bcda-release-api-worker-vars.tfvars \
-out 'bcda-release-api-worker.tfplan'
- name: Terraform Apply
- name: Tofu Apply
run: |
cd terraform/${{ env.RELEASE_ENV }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add working-directory to this step and drop the cd command.

export TF_CLI_ARGS="-no-color"
terraform init
terraform apply bcda-release-api-worker.tfplan
tofu init
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be dropped. No need to init again.

tofu apply bcda-release-api-worker.tfplan
- name: Refresh AutoScaling Groups
run: |
export ASG=`aws autoscaling describe-auto-scaling-groups --region ${{ vars.AWS_REGION }} --filters "Name=tag:Name,Values=bcda-${{ env.RELEASE_ENV }}-api" --query 'AutoScalingGroups[0].AutoScalingGroupName' --output text`
Expand Down