Skip to content

Commit 6f6fc23

Browse files
authored
Merge pull request #8 from non-existing-organization/feature/cw-event-isenabled-property
Feature/cw event isenabled property
2 parents e2e7711 + ff62b58 commit 6f6fc23

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

USAGE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ No requirements.
1616
|------|-------------|------|---------|:--------:|
1717
| attribute\_name | Name of the DynamoDB attribute | `string` | n/a | yes |
1818
| cloudwatch\_event\_rule\_name | Name of the CW event rule | `string` | n/a | yes |
19+
| cw\_event\_is\_enabled | Mark if CW event rule is enabled or not | `bool` | n/a | yes |
1920
| dynamodb\_policy\_name | Name of the DynamoDB iam policy | `string` | n/a | yes |
2021
| function\_name | Name of the aws lambda function | `string` | n/a | yes |
2122
| handler | Handler for the aws lambda function, the structure should be the following --> filename.mainfunction | `string` | n/a | yes |
@@ -29,6 +30,9 @@ No requirements.
2930

3031
## Outputs
3132

32-
No output.
33+
| Name | Description |
34+
|------|-------------|
35+
| function\_arn | n/a |
36+
| function\_invoke\_arn | n/a |
3337

3438
<!--- END_TF_DOCS --->

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ resource "aws_cloudwatch_event_rule" "event_rule" {
113113
name = var.cloudwatch_event_rule_name
114114
description = "Rule that triggers lambda function"
115115
schedule_expression = local.schedule_expression
116+
is_enabled = var.cw_event_is_enabled
116117
}
117118

118119
resource "aws_cloudwatch_event_target" "cloudwatch_event_target" {

outputs.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
output "function_arn" {
2+
value = aws_lambda_function.lambda_function.arn
3+
}
4+
5+
output "function_invoke_arn" {
6+
value = aws_lambda_function.lambda_function.invoke_arn
7+
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@ variable "cloudwatch_event_rule_name" {
5757
variable "lambda_role_name" {
5858
type = string
5959
description = "Name of the aws lambda execution role"
60+
}
61+
62+
variable "cw_event_is_enabled" {
63+
type = bool
64+
description = "Mark if CW event rule is enabled or not"
6065
}

0 commit comments

Comments
 (0)