Skip to content

Commit

Permalink
rename to api_triggered_function_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengaDev committed Jun 3, 2024
1 parent 5ccf235 commit 57a1d15
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ locals {
"gitlab" = coalesce(var.secrets_names, concat(local.shared_default_secrets_names, ["Spectral_GitlabBot_GitlabToken", "Spectral_GitlabBot_WebhookSecret"]))
}
# Please do not change or replace the 'frontend' suffix since there a logic in the bot based in it
api_integrated_function_name = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend"
api_triggered_function_name = local.single_lambda_integration ? local.resource_name_pattern : "${local.resource_name_pattern}-frontend"
}
5 changes: 1 addition & 4 deletions modules/secrets_manager/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
locals {
secrets_arns = concat(
[for secret in aws_secretsmanager_secret.general_secret : secret.arn],
[aws_secretsmanager_secret.spectral_dsn.arn]
)
secrets_arns = [for secret in aws_secretsmanager_secret.general_secret : secret.arn]
}

resource "aws_secretsmanager_secret" "general_secret" {
Expand Down
2 changes: 1 addition & 1 deletion multiple-lambdas-integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "frontend_lambda_function" {
environment = var.environment
integration_type = var.integration_type
# Please do not change or replace the 'frontend' suffix since there a logic in the bot based in it
resource_name_pattern = local.api_integrated_function_name
resource_name_pattern = local.api_triggered_function_name
env_vars = var.env_vars
logs_retention_in_days = var.lambda_logs_retention_in_days
should_write_logs = var.lambda_enable_logs
Expand Down
4 changes: 2 additions & 2 deletions shared.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "api_gateway" {
environment = var.environment
integration_type = var.integration_type
resource_name_pattern = local.resource_name_pattern
function_name = local.function_name
function_name = local.api_triggered_function_name
lambda_function_arn = local.api_triggered_function_arn
}

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

module "lambda_role" {
source = "./modules/role"
role_name = local.function_name
role_name = local.api_triggered_function_name
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
2 changes: 1 addition & 1 deletion single-lambda-integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module "lambda_function" {
tags = var.tags
environment = var.environment
integration_type = var.integration_type
resource_name_pattern = local.api_integrated_function_name
resource_name_pattern = local.api_triggered_function_name
env_vars = var.env_vars
logs_retention_in_days = var.lambda_logs_retention_in_days
should_write_logs = var.lambda_enable_logs
Expand Down
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ variable "store_secret_in_secrets_manager" {
type = bool
description = "Whether to store your secrets in secrets manager, default is false"
default = false

validation {
condition = contains(["github", "gitlab"], var.integration_type)
error_message = "Integration type is invalid"
}
}

variable "resource_name_common_part" {
Expand Down

0 comments on commit 57a1d15

Please sign in to comment.