Skip to content

Commit

Permalink
update shared resources name patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengaDev committed May 23, 2024
1 parent 2e72689 commit d1d4d35
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ override.tf.json
*_override.tf
*_override.tf.json
.terraformrc
terraform.rc
terraform.rc
.DS_Store
2 changes: 1 addition & 1 deletion modules/lambda/lambda.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
runtime = "nodejs20.x"
runtime = "nodejs18.x"
lambda_source_code_zip_path = "${coalesce(var.lambda_source_code_path, "${path.module}/source_code/${var.integration_type}")}/${var.lambda_source_code_filename}"
}

Expand Down
4 changes: 2 additions & 2 deletions shared.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module "api_gateway" {
tags = var.tags
environment = var.environment
integration_type = var.integration_type
resource_name_pattern = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend-${random_string.random_resource_name_suffix.id}"
resource_name_pattern = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend"
lambda_function_arn = local.api_triggered_function_arn
}

Expand All @@ -22,7 +22,7 @@ module "secrets_manager" {

module "lambda_role" {
source = "./modules/role"
resource_name_pattern = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend-${random_string.random_resource_name_suffix.id}"
resource_name_pattern = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend"
store_secret_in_secrets_manager = var.store_secret_in_secrets_manager
secrets_arns = var.store_secret_in_secrets_manager ? module.secrets_manager[0].secrets_arns : []
tags = var.tags
Expand Down
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ variable "integration_type" {
variable "lambda_source_code_path" {
type = string
description = "Path to the lambda source code zip file"
default = null
}

variable "frontend_lambda_source_code_path" {
type = string
description = "Path to the lambda source code zip file of the frontend lambda"
default = null
}

variable "backend_lambda_source_code_path" {
type = string
description = "Path to the lambda source code zip file of the backend lambda"
default = null
}

variable "environment" {
Expand Down Expand Up @@ -99,4 +102,5 @@ variable "store_secret_in_secrets_manager" {
variable "resource_name_common_part" {
type = string
description = "A common part for all resources created under the stack"
default = null
}

0 comments on commit d1d4d35

Please sign in to comment.