Skip to content

Commit

Permalink
Add variable for the DB migrate lambda path
Browse files Browse the repository at this point in the history
This allows the path to be set to a specific location and committed or
cached, so that it is not recreated unnecessarily in an automation
context.
  • Loading branch information
tgvashworth authored and oavdeev committed Oct 24, 2023
1 parent a31ecf1 commit 43fecb7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module "metaflow-metadata-service" {
database_name = module.metaflow-datastore.database_name
database_password = module.metaflow-datastore.database_password
database_username = module.metaflow-datastore.database_username
db_migrate_lambda_zip_file = var.db_migrate_lambda_zip_file
datastore_s3_bucket_kms_key_arn = module.metaflow-datastore.datastore_s3_bucket_kms_key_arn
enable_api_basic_auth = var.metadata_service_enable_api_basic_auth
enable_api_gateway = var.metadata_service_enable_api_gateway
Expand Down
2 changes: 1 addition & 1 deletion modules/metadata-service/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ locals {
api_gateway_stage_name = "api"
api_gateway_usage_plan_name = "${var.resource_prefix}usage-plan${var.resource_suffix}"

db_migrate_lambda_zip_file = "${path.module}/db_migrate_lambda.zip"
db_migrate_lambda_zip_file = coalesce(var.db_migrate_lambda_zip_file, "${path.module}/db_migrate_lambda.zip")
db_migrate_lambda_name = "${var.resource_prefix}db_migrate${var.resource_suffix}"
lambda_ecs_execute_role_name = "${var.resource_prefix}lambda_ecs_execute${var.resource_suffix}"

Expand Down
6 changes: 6 additions & 0 deletions modules/metadata-service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ variable "enable_api_gateway" {
description = "Enable API Gateway for public metadata service endpoint"
}

variable "db_migrate_lambda_zip_file" {
type = string
description = "Output path for the zip file containing the DB migrate lambda"
default = null
}

variable "fargate_execution_role_arn" {
type = string
description = "The IAM role that grants access to ECS and Batch services which we'll use as our Metadata Service API's execution_role for our Fargate instance"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ variable "batch_type" {
default = "ec2"
}

variable "db_migrate_lambda_zip_file" {
type = string
description = "Output path for the zip file containing the DB migrate lambda"
default = null
}

variable "enable_custom_batch_container_registry" {
type = bool
default = false
Expand Down

0 comments on commit 43fecb7

Please sign in to comment.