Skip to content

Commit 53cc9c7

Browse files
committed
[services] Change 'run.sh' to 'terraform-init.sh' and add terraform file exist checks
Summary: This renames the run script in remote to terraform-init, removes the terraform apply, and just prepares the environment for further terraform commands. Test Plan: Ran the scripts. Working properly Reviewers: bartek, varun Reviewed By: bartek Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D10702
1 parent d780c4e commit 53cc9c7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

services/terraform/modules/shared/search_index_lambda.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ variable "lambda_zip_dir" {
88
default = "../../search-index-lambda/target/lambda/search-index-lambda"
99
}
1010

11+
check "lambda_zip_check" {
12+
assert {
13+
condition = fileexists("${var.lambda_zip_dir}/bootstrap.zip")
14+
error_message = "Lambda boostrap.zip not found at path. Please run 'terraform-init.sh' in remote or 'run.sh' in dev"
15+
}
16+
}
17+
1118
resource "aws_lambda_function" "search_index_lambda" {
1219
function_name = "search-index-lambda-function"
1320
filename = "${var.lambda_zip_dir}/bootstrap.zip"

services/terraform/remote/run.sh renamed to services/terraform/remote/terraform-init.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ cargo lambda build --arm64 --output-format zip --release
77

88
cd ../terraform/remote
99
terraform init
10-
terraform apply

0 commit comments

Comments
 (0)