Skip to content

Commit 11acf7e

Browse files
authored
Merge pull request #9 from tomarv2/develop
Pulling refs/heads/develop into main
2 parents 0f19df1 + 3bcdcdf commit 11acf7e

File tree

7 files changed

+10
-26
lines changed

7 files changed

+10
-26
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.64.0
3+
rev: v1.76.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_tflint
@@ -31,7 +31,7 @@ repos:
3131
- id: requirements-txt-fixer
3232

3333
- repo: https://github.com/bridgecrewio/checkov.git
34-
rev: '2.1.226'
34+
rev: '2.1.280'
3535
hooks:
3636
- id: checkov
3737
verbose: true

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,8 @@ No modules.
115115

116116
| Name | Description | Type | Default | Required |
117117
|------|-------------|------|---------|:--------:|
118-
| <a name="input_cloudwatch_event_config"></a> [cloudwatch\_event\_config](#input\_cloudwatch\_event\_config) | Cloudwatch event configuration | `map(any)` | `{}` | no |
118+
| <a name="input_config"></a> [config](#input\_config) | Cloudwatch event configuration | `map(any)` | `{}` | no |
119119
| <a name="input_extra_tags"></a> [extra\_tags](#input\_extra\_tags) | Additional tags to associate | `map(string)` | `{}` | no |
120-
| <a name="input_prjid"></a> [prjid](#input\_prjid) | Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply' | `string` | n/a | yes |
121-
| <a name="input_teamid"></a> [teamid](#input\_teamid) | Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply' | `string` | n/a | yes |
122120

123121
## Outputs
124122

examples/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ provider "aws" {
1313

1414
module "cloudwatch_event" {
1515
source = "../"
16-
cloudwatch_event_config = {
16+
config = {
1717
demo_rule = {
1818
service_role = "arn:aws:iam::123456789012:role/demo-role"
1919
target_arn = "<lambda_role>"

examples/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ variable "region" {
1616
type = string
1717
}
1818

19-
variable "cloudwatch_event_config" {
19+
variable "config" {
2020
description = "Cloudwatch event configuration"
2121
type = map(any)
2222
default = {}

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
resource "aws_cloudwatch_event_rule" "event_rule" {
2-
for_each = var.cloudwatch_event_config != null ? var.cloudwatch_event_config : {}
2+
for_each = var.config != null ? var.config : {}
33

44
name = each.key
5-
description = try(each.value.description, "Terraform managed: ${var.teamid}-${var.prjid}")
5+
description = try(each.value.description, "Terraform managed")
66
schedule_expression = try(each.value.schedule, "rate(1 day)")
77
role_arn = each.value.service_role
88

99
tags = merge(local.shared_tags, var.extra_tags)
1010
}
1111

1212
resource "aws_cloudwatch_event_target" "event_target_input_type" {
13-
for_each = var.cloudwatch_event_config != null ? var.cloudwatch_event_config : {}
13+
for_each = var.config != null ? var.config : {}
1414

1515
target_id = each.key
1616
rule = join("", [for rule in aws_cloudwatch_event_rule.event_rule : rule.id])

tags.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
locals {
22
shared_tags = tomap(
3-
{
4-
"Name" = "${var.teamid}-${var.prjid}",
5-
"Team" = var.teamid,
6-
"Project" = var.prjid
7-
}
3+
{}
84
)
95
}

variables.tf

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
variable "teamid" {
2-
description = "Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply'"
3-
type = string
4-
}
5-
6-
variable "prjid" {
7-
description = "Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply'"
8-
type = string
9-
}
10-
11-
variable "cloudwatch_event_config" {
1+
variable "config" {
122
description = "Cloudwatch event configuration"
133
type = map(any)
144
default = {}

0 commit comments

Comments
 (0)