-
Notifications
You must be signed in to change notification settings - Fork 16
[PLT-1340] Convert terraform to opentofu #1212
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
Changes from 8 commits
72aa2bf
34752bd
468ac05
1eb827a
341bc41
5fa95bf
8ca15b7
765ec76
21a4cd9
192de13
e497c4f
eb89724
6e71e06
e83dedc
8165380
a1f7940
310dd54
ca39eac
3708a8f
751ac97
28cc9c2
1d7c156
e73b735
b9142e7
f21ad51
b293e55
5dd1739
a719d00
19480f0
66bd4bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
- name: Init, Plan OpenTofu | ||
run: | | ||
juliareynolds-nava marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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" | ||
|
||
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 | ||
juliareynolds-nava marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
run: | | ||
cd terraform/${{ env.RELEASE_ENV }} | ||
|
||
export TF_CLI_ARGS="-no-color" | ||
terraform init | ||
terraform apply bcda-release-api-worker.tfplan | ||
tofu init | ||
|
||
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` | ||
|
Uh oh!
There was an error while loading. Please reload this page.