mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Merge pull request #859 from Hestia-Homes/deploy-fastapi-with-terraform
Deploy fastapi with terraform: move the depends_on pip install to the correct place
This commit is contained in:
commit
41693b2058
2 changed files with 3 additions and 1 deletions
|
|
@ -51,7 +51,6 @@ locals {
|
||||||
# FastAPI Lambda + API Gateway
|
# FastAPI Lambda + API Gateway
|
||||||
############################################
|
############################################
|
||||||
module "fastapi" {
|
module "fastapi" {
|
||||||
depends_on = [null_resource.pip_install]
|
|
||||||
source = "../../modules/lambda_with_api_gateway"
|
source = "../../modules/lambda_with_api_gateway"
|
||||||
|
|
||||||
name = "fastapi"
|
name = "fastapi"
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ module "role" {
|
||||||
# Install python packages
|
# Install python packages
|
||||||
############################################
|
############################################
|
||||||
resource "null_resource" "pip_install" {
|
resource "null_resource" "pip_install" {
|
||||||
|
count = var.requirements_file != null ? 1 : 0
|
||||||
|
|
||||||
triggers = {
|
triggers = {
|
||||||
requirements_hash = filemd5("${var.requirements_file}")
|
requirements_hash = filemd5("${var.requirements_file}")
|
||||||
}
|
}
|
||||||
|
|
@ -23,6 +25,7 @@ resource "null_resource" "pip_install" {
|
||||||
# Zip the source code
|
# Zip the source code
|
||||||
############################################
|
############################################
|
||||||
data "archive_file" "this" {
|
data "archive_file" "this" {
|
||||||
|
depends_on = [null_resource.pip_install]
|
||||||
type = "zip"
|
type = "zip"
|
||||||
source_dir = var.source_dir
|
source_dir = var.source_dir
|
||||||
output_path = "${path.module}/lambda_package.zip"
|
output_path = "${path.module}/lambda_package.zip"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue