Skip to content

Commit

Permalink
✨ change name of variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tonystrawberry committed Nov 8, 2023
1 parent 2c4de2c commit 8fcf420
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ terraform.rc
.env

# Ignore the output folder (only used for local testing)
lambda-jobs/output
lambda-jobs/outputs

# Ignore .terraform directories
**/.terraform/*
6 changes: 3 additions & 3 deletions terraform/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "api-gateway" {
source = "./modules/api-gateway"

aws_lambda_function_invoke_arn = module.lambda.aws_lambda_function_invoke_arn
lgtm_api_aws_lambda_function_invoke_arn = module.lambda.lgtm_api_aws_lambda_function_invoke_arn
}

module "cloudfront" {
Expand All @@ -14,8 +14,8 @@ module "cloudfront" {
module "eventbridge" {
source = "./modules/eventbridge"

aws_lambda_function_arn = module.lambda.aws_lambda_function_arn
aws_lambda_function_name = module.lambda.aws_lambda_function_name
lgtm_job_aws_lambda_function_arn = module.lambda.lgtm_job_aws_lambda_function_arn
lgtm_job_aws_lambda_function_name = module.lambda.lgtm_job_aws_lambda_function_name
}

module "ecr" {
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/api-gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_api_gateway_rest_api" "lgtm_api_aws_api_gateway_rest_api" {
httpMethod = "POST"
payloadFormatVersion = "1.0"
type = "AWS_PROXY"
uri = var.aws_lambda_function_invoke_arn # aws_lambda_function.lgtm_api_aws_lambda_function.invoke_arn
uri = var.lgtm_api_aws_lambda_function_invoke_arn # aws_lambda_function.lgtm_api_aws_lambda_function.invoke_arn
credentials = aws_iam_role.lgtm_api_gateway_aws_iam_role.arn
}
}
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/api-gateway/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variable "aws_lambda_function_invoke_arn" {
variable "lgtm_api_aws_lambda_function_invoke_arn" {
description = "ARN of the Lambda function to invoke"
type = string
}
4 changes: 2 additions & 2 deletions terraform/modules/eventbridge/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_cloudwatch_event_rule" "lgtm_job_aws_cloudwatch_event_rule" {
# Create a target for the EventBridge rule to trigger the Lambda function with a payload
resource "aws_cloudwatch_event_target" "lgtm_job_aws_cloudwatch_event_target" {
rule = aws_cloudwatch_event_rule.lgtm_job_aws_cloudwatch_event_rule.name
arn = var.aws_lambda_function_arn
arn = var.lgtm_job_aws_lambda_function_arn
target_id = "lgtm-tonystrawberry-codes-job"

input = <<JSON
Expand All @@ -23,7 +23,7 @@ JSON
resource "aws_lambda_permission" "lgtm_job_aws_lambda_permission" {
statement_id = "AllowExecutionFromEventBridge"
action = "lambda:InvokeFunction"
function_name = var.aws_lambda_function_name # aws_lambda_function.lgtm_job_aws_lambda_function.function_name
function_name = var.lgtm_job_aws_lambda_function_name # aws_lambda_function.lgtm_job_aws_lambda_function.function_name
principal = "events.amazonaws.com"
source_arn = aws_cloudwatch_event_rule.lgtm_job_aws_cloudwatch_event_rule.arn
}
4 changes: 2 additions & 2 deletions terraform/modules/eventbridge/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
variable "aws_lambda_function_arn" {
variable "lgtm_job_aws_lambda_function_arn" {
description = "ARN of the Lambda function to invoke"
type = string
}

variable "aws_lambda_function_name" {
variable "lgtm_job_aws_lambda_function_name" {
description = "Name of the Lambda function to invoke"
type = string
}
6 changes: 3 additions & 3 deletions terraform/modules/lambda/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output "aws_lambda_function_invoke_arn" {
output "lgtm_api_aws_lambda_function_invoke_arn" {
value = aws_lambda_function.lgtm_api_aws_lambda_function.invoke_arn
}

output "aws_lambda_function_arn" {
output "lgtm_job_aws_lambda_function_arn" {
value = aws_lambda_function.lgtm_job_aws_lambda_function.arn
}

output "aws_lambda_function_name" {
output "lgtm_job_aws_lambda_function_name" {
value = aws_lambda_function.lgtm_job_aws_lambda_function.function_name
}

0 comments on commit 8fcf420

Please sign in to comment.