Skip to content

Commit

Permalink
rework Lambda naming
Browse files Browse the repository at this point in the history
  • Loading branch information
craigzour committed May 1, 2024
1 parent cba1c19 commit 639bc87
Show file tree
Hide file tree
Showing 72 changed files with 67 additions and 67 deletions.
26 changes: 13 additions & 13 deletions .github/lambda-filter.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
audit-logs: "lambda-code/audit-logs/**"
audit-logs-archiver: "lambda-code/audit-logs-archiver/**"
cognito-email-sender: "lambda-code/cognito-email-sender/**"
cognito-pre-sign-up: "lambda-code/cognito-pre-sign-up/**"
form-archiver: "lambda-code/form-archiver/**"
load-testing: "lambda-code/load-testing/**"
nagware: "lambda-code/nagware/**"
notify-slack: "lambda-code/notify-slack/**"
reliability: "lambda-code/reliability/**"
reliability-dlq-consumer: "lambda-code/reliability-dlq-consumer/**"
response-archiver: "lambda-code/response-archiver/**"
submission: "lambda-code/submission/**"
vault-integrity: "lambda-code/vault-integrity/**"
AuditLogs: "lambda-code/AuditLogs/**"
AuditLogsArchiver: "lambda-code/AuditLogsArchiver/**"
CognitoEmailSender: "lambda-code/CognitoEmailSender/**"
CognitoPreSignUp: "lambda-code/CognitoPreSignUp/**"
FormArchiver: "lambda-code/FormArchiver/**"
LoadTesting: "lambda-code/LoadTesting/**"
Nagware: "lambda-code/Nagware/**"
NotifySlack: "lambda-code/NotifySlack/**"
Reliability: "lambda-code/Reliability/**"
ReliabilityDlqConsumer: "lambda-code/ReliabilityDlqConsumer/**"
ResponseArchiver: "lambda-code/ResponseArchiver/**"
Submission: "lambda-code/Submission/**"
VaultIntegrity: "lambda-code/VaultIntegrity/**"
2 changes: 1 addition & 1 deletion aws/alarms/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#tfsec:ignore:aws-lambda-enable-tracing
resource "aws_lambda_function" "notify_slack" {
function_name = "notify-slack"
function_name = "NotifySlack"
image_uri = "${var.ecr_repository_url_notify_slack_lambda}:latest"
package_type = "Image"
role = aws_iam_role.notify_slack_lambda.arn
Expand Down
4 changes: 2 additions & 2 deletions aws/cognito/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
########################

resource "aws_lambda_function" "cognito_email_sender" {
function_name = "cognito-email-sender"
function_name = "CognitoEmailSender"
image_uri = "${var.ecr_repository_url_cognito_email_sender_lambda}:latest"
package_type = "Image"
role = aws_iam_role.cognito_lambda.arn
Expand Down Expand Up @@ -48,7 +48,7 @@ resource "aws_cloudwatch_log_group" "cognito_email_sender" {
########################

resource "aws_lambda_function" "cognito_pre_sign_up" {
function_name = "cognito-pre-sign-up"
function_name = "CognitoPreSignUp"
image_uri = "${var.ecr_repository_url_cognito_pre_sign_up_lambda}:latest"
package_type = "Image"
role = aws_iam_role.cognito_lambda.arn
Expand Down
24 changes: 12 additions & 12 deletions aws/ecr/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ resource "aws_ecr_lifecycle_policy" "form_viewer_policy" {

locals {
ecr_names = toset([
"audit-logs-lambda",
"audit-logs-archiver-lambda",
"form-archiver-lambda",
"nagware-lambda",
"reliability-lambda",
"reliability-dlq-consumer-lambda",
"response-archiver-lambda",
"submission-lambda",
"vault-integrity-lambda",
"notify-slack-lambda",
"cognito-email-sender-lambda",
"cognito-pre-sign-up-lambda"
"AuditLogs-lambda",
"AuditLogsArchiver-lambda",
"CognitoEmailSender-lambda",
"CognitoPreSignUp-lambda",
"FormArchiver-lambda",
"Nagware-lambda",
"NotifySlack-lambda",
"Reliability-lambda",
"ReliabilityDlqConsumer-lambda",
"ResponseArchiver-lambda",
"Submission-lambda",
"VaultIntegrity-lambda"
])
}

Expand Down
50 changes: 25 additions & 25 deletions aws/ecr/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@ output "ecr_repository_url_form_viewer" {

output "ecr_repository_url_audit_logs_lambda" {
description = "URL of the Audit Logs Lambda ECR"
value = aws_ecr_repository.lambda["audit-logs-lambda"].repository_url
value = aws_ecr_repository.lambda["AuditLogs-lambda"].repository_url
}

output "ecr_repository_url_audit_logs_archiver_lambda" {
description = "URL of the Audit Logs Archiver Lambda ECR"
value = aws_ecr_repository.lambda["audit-logs-archiver-lambda"].repository_url
value = aws_ecr_repository.lambda["AuditLogsArchiver-lambda"].repository_url
}

output "ecr_repository_url_cognito_email_sender_lambda" {
description = "URL of the Cognito Email Sender Lambda ECR"
value = aws_ecr_repository.lambda["CognitoEmailSender-lambda"].repository_url
}

output "ecr_repository_url_cognito_pre_sign_up_lambda" {
description = "URL of the Cognito Pre Sign Up Lambda ECR"
value = aws_ecr_repository.lambda["CognitoPreSignUp-lambda"].repository_url
}

output "ecr_repository_url_form_archiver_lambda" {
description = "URL of the Form Archiver Lambda ECR"
value = aws_ecr_repository.lambda["form-archiver-lambda"].repository_url
value = aws_ecr_repository.lambda["FormArchiver-lambda"].repository_url
}

output "ecr_repository_url_nagware_lambda" {
description = "URL of the Nagware Lambda ECR"
value = aws_ecr_repository.lambda["nagware-lambda"].repository_url
value = aws_ecr_repository.lambda["Nagware-lambda"].repository_url
}

output "ecr_repository_url_notify_slack_lambda" {
description = "URL of the Notify Slack Lambda ECR"
value = aws_ecr_repository.lambda["NotifySlack-lambda"].repository_url
}

output "ecr_repository_url_reliability_lambda" {
description = "URL of the Reliability Lambda ECR"
value = aws_ecr_repository.lambda["reliability-lambda"].repository_url
value = aws_ecr_repository.lambda["Reliability-lambda"].repository_url
}

output "ecr_repository_url_reliability_dlq_consumer_lambda" {
description = "URL of the Reliability DLQ Consumer Lambda ECR"
value = aws_ecr_repository.lambda["reliability-dlq-consumer-lambda"].repository_url
value = aws_ecr_repository.lambda["ReliabilityDlqConsumer-lambda"].repository_url
}

output "ecr_repository_url_response_archiver_lambda" {
description = "URL of the Response Archiver Lambda ECR"
value = aws_ecr_repository.lambda["response-archiver-lambda"].repository_url
value = aws_ecr_repository.lambda["ResponseArchiver-lambda"].repository_url
}

output "ecr_repository_url_submission_lambda" {
description = "URL of the Submission Lambda ECR"
value = aws_ecr_repository.lambda["submission-lambda"].repository_url
value = aws_ecr_repository.lambda["Submission-lambda"].repository_url
}

output "ecr_repository_url_vault_integrity_lambda" {
description = "URL of the Vault Integrity Lambda ECR"
value = aws_ecr_repository.lambda["vault-integrity-lambda"].repository_url
}

output "ecr_repository_url_notify_slack_lambda" {
description = "URL of the Notify Slack Lambda ECR"
value = aws_ecr_repository.lambda["notify-slack-lambda"].repository_url
}

output "ecr_repository_url_cognito_email_sender_lambda" {
description = "URL of the Cognito Email Sender Lambda ECR"
value = aws_ecr_repository.lambda["cognito-email-sender-lambda"].repository_url
}

output "ecr_repository_url_cognito_pre_sign_up_lambda" {
description = "URL of the Cognito Pre Sign Up Lambda ECR"
value = aws_ecr_repository.lambda["cognito-pre-sign-up-lambda"].repository_url
value = aws_ecr_repository.lambda["VaultIntegrity-lambda"].repository_url
}

output "ecr_repository_url_load_test" {
description = "URL of the Form viewer ECR"
value = length(aws_ecr_repository.load_test_repository) > 0 ? aws_ecr_repository.load_test_repository[0].repository_url : ""
}
}
2 changes: 1 addition & 1 deletion aws/lambdas/audit_log.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

resource "aws_lambda_function" "audit_logs" {
function_name = "audit-logs"
function_name = "AuditLogs"
image_uri = "${var.ecr_repository_url_audit_logs_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/audit_logs_archiver.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_lambda_function" "audit_logs_archiver" {
function_name = "audit-logs-archiver"
function_name = "AuditLogsArchiver"
image_uri = "${var.ecr_repository_url_audit_logs_archiver_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/form_archiver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

resource "aws_lambda_function" "form_archiver" {
function_name = "form-archiver"
function_name = "FormArchiver"
image_uri = "${var.ecr_repository_url_form_archiver_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/nagware.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

resource "aws_lambda_function" "nagware" {
function_name = "nagware"
function_name = "Nagware"
image_uri = "${var.ecr_repository_url_nagware_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/reliability.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "aws_lambda_function" "reliability" {
function_name = "reliability"
function_name = "Reliability"
image_uri = "${var.ecr_repository_url_reliability_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/reliability_dlq_consumer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

resource "aws_lambda_function" "reliability_dlq_consumer" {
function_name = "reliability-dlq-consumer"
function_name = "ReliabilityDlqConsumer"
image_uri = "${var.ecr_repository_url_reliability_dlq_consumer_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/response_archiver.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

resource "aws_lambda_function" "response_archiver" {
function_name = "response-archiver"
function_name = "ResponseArchiver"
image_uri = "${var.ecr_repository_url_response_archiver_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/submission.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

resource "aws_lambda_function" "submission" {
function_name = "submission"
function_name = "Submission"
image_uri = "${var.ecr_repository_url_submission_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
2 changes: 1 addition & 1 deletion aws/lambdas/vault_integrity.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

resource "aws_lambda_function" "vault_integrity" {
function_name = "vault-integrity"
function_name = "VaultIntegrity"
image_uri = "${var.ecr_repository_url_vault_integrity_lambda}:latest"
package_type = "Image"
role = aws_iam_role.lambda.arn
Expand Down
4 changes: 2 additions & 2 deletions aws/load_testing/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

resource "aws_lambda_function" "load_testing" {
image_uri = "${var.ecr_repository_url_load_test}:latest"
function_name = "load-testing"
function_name = "LoadTesting"
role = aws_iam_role.load_test_lambda.arn
timeout = 300
memory_size = 200
Expand Down Expand Up @@ -55,4 +55,4 @@ data "aws_iam_policy_document" "lambda_assume_policy" {
resource "aws_iam_role_policy_attachment" "load_test_lambda_basic_access" {
role = aws_iam_role.load_test_lambda.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
}
}
2 changes: 1 addition & 1 deletion env/cloud/alarms/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependency "lambdas" {
lambda_response_archiver_log_group_name = "/aws/lambda/Response_Archiver"
lambda_submission_log_group_name = "/aws/lambda/Submission"
lambda_vault_integrity_log_group_name = "/aws/lambda/Vault_Data_Integrity_Check"
lambda_vault_integrity_function_name = "vault-integrity"
lambda_vault_integrity_function_name = "VaultIntegrity"
}
}

Expand Down
2 changes: 1 addition & 1 deletion env/cloud/pr_review/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependency "lambdas" {
mock_outputs_merge_with_state = true
mock_outputs_merge_strategy_with_state = "shallow"
mock_outputs = {
lambda_submission_function_name = "submission"
lambda_submission_function_name = "Submission"
}
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lambda-code/deploy-lambda-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ redColor='\033[0;31m'
reset='\033[0m' # No Color

ecrRepositoryAddress=000000000000.dkr.ecr.ca-central-1.localhost.localstack.cloud:4511
lambdasToSkip=("cognito-email-sender", "cognito-pre-sign-up", "notify-slack", "load-testing")
lambdasToSkip=("CognitoEmailSender", "CognitoPreSignUp", "NotifySlack", "LoadTesting")
basedir=$(pwd)

if ! command -v awslocal > /dev/null; then
Expand Down

0 comments on commit 639bc87

Please sign in to comment.