Skip to content

Commit 256cbc7

Browse files
authored
Merge pull request #6 from non-existing-organization/fix/remove-vars
fix vars & names
2 parents 1ec53e3 + b90ff9e commit 256cbc7

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

USAGE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ No requirements.
2525
| region | n/a | `string` | `"us-east-1"` | no |
2626
| schedule\_expression | Cloudwatch rule rate expression for how frequent you want the lambda function to run | `string` | n/a | yes |
2727
| source\_code\_hash | hash of the current zip file, changes in the function code will produce an update of the lambda function | `string` | n/a | yes |
28-
| source\_file | The path in your filesystem where your script is located | `string` | n/a | yes |
2928
| table\_name | Name of the DynamoDB table | `string` | n/a | yes |
3029

3130
## Outputs

main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ resource "aws_iam_role_policy_attachment" "dynamodb_full" {
6161

6262
resource "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
112112
resource "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
]

variables.tf

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ variable "region" {
33
default = "us-east-1"
44
}
55

6-
variable "source_file" {
7-
type = string
8-
description = "The path in your filesystem where your script is located"
9-
}
10-
116
variable "output_path" {
127
type = string
138
description = "The path and name of the resulting zip file"
@@ -19,13 +14,13 @@ variable "function_name" {
1914
}
2015

2116
variable "lambda_runtime" {
22-
type = string
17+
type = string
2318
description = "Lambda runtime i.e <python3.8>"
24-
default = "python3.8"
19+
default = "python3.8"
2520
}
2621

2722
variable "source_code_hash" {
28-
type = string
23+
type = string
2924
description = "hash of the current zip file, changes in the function code will produce an update of the lambda function"
3025
}
3126

0 commit comments

Comments
 (0)