There's an issue in the cd-deploy.yml file in github workflows, on line 35 under tf-apply:
if: ${{ steps.tf-plan.outcome }} == 'success'
This needed to be corrected to:
if: ${{ steps.tf-plan.outcome == 'success' }}
I also found set-output is deprecated. This was the corrected code snippet that worked:
- name: TF Apply
id: tf-apply
working-directory: '06-best-practices/code/infrastructure'
if: ${{ steps.tf-plan.outcome == 'success' }}
run: |
terraform apply -auto-approve -var-file=vars/prod.tfvars
echo "ecr_repo=$(terraform output -raw ecr_repo)" >> $GITHUB_OUTPUT
echo "predictions_stream_name=$(terraform output -raw predictions_stream_name)" >> $GITHUB_OUTPUT
echo "model_bucket=$(terraform output -raw model_bucket)" >> $GITHUB_OUTPUT
echo "lambda_function=$(terraform output -raw lambda_function)" >> $GITHUB_OUTPUT
There's an issue in the cd-deploy.yml file in github workflows, on line 35 under tf-apply:
if: ${{ steps.tf-plan.outcome }} == 'success'This needed to be corrected to:
if: ${{ steps.tf-plan.outcome == 'success' }}I also found set-output is deprecated. This was the corrected code snippet that worked: