Merge pull request #875 from Hestia-Homes/deploy-fastapi-with-terraform

Deploy fastapi with terraform: dont use _deploy_lambda workflow
This commit is contained in:
Jun-te Kim 2026-03-13 14:40:08 +00:00 committed by GitHub
commit aade3a42ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -351,14 +351,36 @@ jobs:
# ============================================================
cloudfront_cdn:
needs: [determine_stage, shared_terraform, fast_api_lambda]
uses: ./.github/workflows/_deploy_lambda.yml
with:
lambda_name: ara_cdn
lambda_path: infrastructure/terraform/cdn
stage: ${{ needs.determine_stage.outputs.stage }}
terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.DEV_AWS_REGION }}
runs-on: ubuntu-latest
env:
STAGE: ${{ needs.determine_stage.outputs.stage }}
TERRAFORM_APPLY: ${{ needs.determine_stage.outputs.terraform_apply }}
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.DEV_AWS_REGION }}
- uses: hashicorp/setup-terraform@v3
- name: Terraform Init
working-directory: infrastructure/terraform/cdn
run: terraform init -reconfigure
- name: Terraform Workspace
working-directory: infrastructure/terraform/cdn
run: terraform workspace select ${STAGE} || terraform workspace new ${STAGE}
- name: Terraform Plan
working-directory: infrastructure/terraform/cdn
run: terraform plan -var-file=${STAGE}.tfvars -out=tfplan
- name: Terraform Apply
if: env.TERRAFORM_APPLY == 'true'
working-directory: infrastructure/terraform/cdn
run: terraform apply -auto-approve tfplan