Skip to content

Commit 87a37da

Browse files
committed
name-space resources
1 parent 430c00d commit 87a37da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

terraform-unity/lambda.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data "aws_iam_policy" "mcp_operator_policy" {
99
}
1010

1111
resource "aws_iam_role" "lambda_execution_role" {
12-
name = "unity-cs-monitoring-lambda-role"
12+
name = "unity-${var.project}-${var.venue}-cs-monitoring-lambda-role"
1313

1414
assume_role_policy = jsonencode({
1515
Version = "2012-10-17",
@@ -27,7 +27,7 @@ resource "aws_iam_role" "lambda_execution_role" {
2727
}
2828

2929
resource "aws_iam_policy" "lambda_ssm_s3_policy" {
30-
name = "unity-cs-monitoring-lambda-policy"
30+
name = "unity-${var.project}-${var.venue}-cs-monitoring-lambda-policy"
3131
description = "Policy to allow Lambda to read/write SSM and send objects to S3"
3232

3333
policy = jsonencode({
@@ -61,7 +61,7 @@ resource "aws_iam_role_policy_attachment" "attach_ssm_s3_policy" {
6161
}
6262

6363
resource "aws_lambda_function" "unity_cs_monitoring_lambda" {
64-
function_name = "unity_cs_monitoring_lambda"
64+
function_name = "unity-${var.project}-${var.venue}-cs-monitoring-lambda"
6565
role = aws_iam_role.lambda_execution_role.arn
6666
handler = "lambda_function.lambda_handler"
6767
runtime = "python3.12"
@@ -80,7 +80,7 @@ resource "aws_lambda_function" "unity_cs_monitoring_lambda" {
8080
}
8181

8282
resource "aws_cloudwatch_event_rule" "every_five_minutes" {
83-
name = "every_five_minutes"
83+
name = "${var.project}-${var.venue}-every_five_minutes"
8484
schedule_expression = "rate(5 minutes)"
8585
}
8686

0 commit comments

Comments
 (0)