@@ -61,7 +61,7 @@ resource "aws_iam_role_policy_attachment" "dynamodb_full" {
6161
6262resource "aws_iam_policy" "dynamodb-policy" {
6363 name = var. dynamodb_policy_name
64- description = " Sg checker dynamodb policy"
64+ description = " Dynamodb policy"
6565 policy = jsonencode ({
6666 Version = " 2012-10-17"
6767 Statement = [
@@ -78,7 +78,7 @@ resource "aws_iam_policy" "dynamodb-policy" {
7878 " dynamodb:ConditionCheckItem"
7979 ]
8080 Effect = " Allow"
81- Resource = " arn:aws:dynamodb:${ var . region } :${ data . aws_caller_identity . current . account_id } :table/${ aws_dynamodb_table . sg_dynamo_table . name } "
81+ Resource = " arn:aws:dynamodb:${ var . region } :${ data . aws_caller_identity . current . account_id } :table/${ aws_dynamodb_table . dynamodb_table . name } "
8282 },
8383 ]
8484 })
@@ -93,7 +93,7 @@ resource "aws_lambda_permission" "allow_cloudwatch_to_call_lambda" {
9393}
9494
9595# DynamoDB table definition
96- resource "aws_dynamodb_table" "sg_dynamo_table " {
96+ resource "aws_dynamodb_table" "dynamodb_table " {
9797 name = local. table_name
9898 billing_mode = " PROVISIONED"
9999 read_capacity = " 30"
@@ -111,11 +111,11 @@ resource "aws_dynamodb_table" "sg_dynamo_table" {
111111# Cloudwatch rule definition
112112resource "aws_cloudwatch_event_rule" "event_rule" {
113113 name = var. cloudwatch_event_rule_name
114- description = " Rule that triggers the sg checker lambda"
114+ description = " Rule that triggers lambda function "
115115 schedule_expression = local. schedule_expression
116116}
117117
118- resource "aws_cloudwatch_event_target" "sg_checker_target " {
118+ resource "aws_cloudwatch_event_target" "cloudwatch_event_target " {
119119 depends_on = [
120120 aws_cloudwatch_event_rule . event_rule
121121 ]
0 commit comments