Skip to content

Commit 5e23e04

Browse files
authored
feat: Shorten outputs (removing this_) (#21)
1 parent 77f54d8 commit 5e23e04

File tree

27 files changed

+80
-81
lines changed

27 files changed

+80
-81
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.48.0
3+
rev: v1.50.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This type of resources are supported:
1414
```hcl
1515
module "log_metric_filter" {
1616
source = "terraform-aws-modules/cloudwatch/aws//modules/log-metric-filter"
17-
version = "~> 1.0"
17+
version = "~> 2.0"
1818
1919
log_group_name = "my-application-logs"
2020
@@ -33,7 +33,7 @@ Read [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/la
3333
```hcl
3434
module "metric_alarm" {
3535
source = "terraform-aws-modules/cloudwatch/aws//modules/metric-alarm"
36-
version = "~> 1.0"
36+
version = "~> 2.0"
3737
3838
alarm_name = "my-application-logs-errors"
3939
alarm_description = "Bad errors in my-application-logs"
@@ -58,7 +58,7 @@ This submodule is useful when you need to create very similar alarms where only
5858
```hcl
5959
module "metric_alarms" {
6060
source = "terraform-aws-modules/cloudwatch/aws//modules/metric-alarms-by-multiple-dimensions"
61-
version = "~> 1.0"
61+
version = "~> 2.0"
6262
6363
alarm_name = "lambda-duration-"
6464
alarm_description = "Lambda duration is too high"
@@ -92,7 +92,7 @@ Check out [list of all AWS services that publish CloudWatch metrics](https://doc
9292
```hcl
9393
module "cis_alarms" {
9494
source = "terraform-aws-modules/cloudwatch/aws//modules/cis-alarms"
95-
version = "~> 1.0"
95+
version = "~> 2.0"
9696
9797
log_group_name = "my-cloudtrail-logs"
9898
alarm_actions = ["arn:aws:sns:eu-west-1:835367859852:my-sns-queue"]

examples/cis-alarms/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ No inputs.
4747

4848
| Name | Description |
4949
|------|-------------|
50-
| <a name="output_this_cloudwatch_metric_alarm_arns"></a> [this\_cloudwatch\_metric\_alarm\_arns](#output\_this\_cloudwatch\_metric\_alarm\_arns) | List of ARNs of the Cloudwatch metric alarm |
51-
| <a name="output_this_cloudwatch_metric_alarm_ids"></a> [this\_cloudwatch\_metric\_alarm\_ids](#output\_this\_cloudwatch\_metric\_alarm\_ids) | List of IDs of the Cloudwatch metric alarm |
50+
| <a name="output_cloudwatch_metric_alarm_arns"></a> [cloudwatch\_metric\_alarm\_arns](#output\_cloudwatch\_metric\_alarm\_arns) | List of ARNs of the Cloudwatch metric alarm |
51+
| <a name="output_cloudwatch_metric_alarm_ids"></a> [cloudwatch\_metric\_alarm\_ids](#output\_cloudwatch\_metric\_alarm\_ids) | List of IDs of the Cloudwatch metric alarm |
5252
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/cis-alarms/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module "all_cis_alarms" {
1515

1616
disabled_controls = ["DisableOrDeleteCMK", "VPCChanges"]
1717

18-
log_group_name = module.log.this_cloudwatch_log_group_name
19-
alarm_actions = [module.aws_sns_topic.this_sns_topic_arn]
18+
log_group_name = module.log.cloudwatch_log_group_name
19+
alarm_actions = [module.aws_sns_topic.sns_topic_arn]
2020
}
2121

2222
# These alarms won't be created
@@ -27,6 +27,6 @@ module "disabled_all_cis_alarms" {
2727

2828
use_random_name_prefix = true
2929

30-
log_group_name = module.log.this_cloudwatch_log_group_name
31-
alarm_actions = [module.aws_sns_topic.this_sns_topic_arn]
30+
log_group_name = module.log.cloudwatch_log_group_name
31+
alarm_actions = [module.aws_sns_topic.sns_topic_arn]
3232
}

examples/cis-alarms/outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
output "this_cloudwatch_metric_alarm_arns" {
1+
output "cloudwatch_metric_alarm_arns" {
22
description = "List of ARNs of the Cloudwatch metric alarm"
3-
value = module.all_cis_alarms.this_cloudwatch_metric_alarm_arns
3+
value = module.all_cis_alarms.cloudwatch_metric_alarm_arns
44
}
55

6-
output "this_cloudwatch_metric_alarm_ids" {
6+
output "cloudwatch_metric_alarm_ids" {
77
description = "List of IDs of the Cloudwatch metric alarm"
8-
value = module.all_cis_alarms.this_cloudwatch_metric_alarm_ids
8+
value = module.all_cis_alarms.cloudwatch_metric_alarm_ids
99
}

examples/complete-log-metric-filter-and-alarm/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ No inputs.
4747

4848
| Name | Description |
4949
|------|-------------|
50-
| <a name="output_this_cloudwatch_log_metric_filter_id"></a> [this\_cloudwatch\_log\_metric\_filter\_id](#output\_this\_cloudwatch\_log\_metric\_filter\_id) | The name of the metric filter |
51-
| <a name="output_this_cloudwatch_metric_alarm_arn"></a> [this\_cloudwatch\_metric\_alarm\_arn](#output\_this\_cloudwatch\_metric\_alarm\_arn) | The ARN of the Cloudwatch metric alarm |
52-
| <a name="output_this_cloudwatch_metric_alarm_id"></a> [this\_cloudwatch\_metric\_alarm\_id](#output\_this\_cloudwatch\_metric\_alarm\_id) | The ID of the Cloudwatch metric alarm |
50+
| <a name="output_cloudwatch_log_metric_filter_id"></a> [cloudwatch\_log\_metric\_filter\_id](#output\_cloudwatch\_log\_metric\_filter\_id) | The name of the metric filter |
51+
| <a name="output_cloudwatch_metric_alarm_arn"></a> [cloudwatch\_metric\_alarm\_arn](#output\_cloudwatch\_metric\_alarm\_arn) | The ARN of the Cloudwatch metric alarm |
52+
| <a name="output_cloudwatch_metric_alarm_id"></a> [cloudwatch\_metric\_alarm\_id](#output\_cloudwatch\_metric\_alarm\_id) | The ID of the Cloudwatch metric alarm |
5353
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete-log-metric-filter-and-alarm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
module "log_metric_filter" {
1919
source = "../../modules/log-metric-filter"
2020

21-
log_group_name = module.log.this_cloudwatch_log_group_name
21+
log_group_name = module.log.cloudwatch_log_group_name
2222

2323
name = "metric-${module.log.random_id}"
2424
pattern = "ERROR"
@@ -42,5 +42,5 @@ module "alarm" {
4242
metric_name = local.metric_transformation_name
4343
statistic = "Sum"
4444

45-
alarm_actions = [module.aws_sns_topic.this_sns_topic_arn]
45+
alarm_actions = [module.aws_sns_topic.sns_topic_arn]
4646
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
output "this_cloudwatch_log_metric_filter_id" {
1+
output "cloudwatch_log_metric_filter_id" {
22
description = "The name of the metric filter"
3-
value = module.log_metric_filter.this_cloudwatch_log_metric_filter_id
3+
value = module.log_metric_filter.cloudwatch_log_metric_filter_id
44
}
55

6-
output "this_cloudwatch_metric_alarm_arn" {
6+
output "cloudwatch_metric_alarm_arn" {
77
description = "The ARN of the Cloudwatch metric alarm"
8-
value = module.alarm.this_cloudwatch_metric_alarm_arn
8+
value = module.alarm.cloudwatch_metric_alarm_arn
99
}
1010

11-
output "this_cloudwatch_metric_alarm_id" {
11+
output "cloudwatch_metric_alarm_id" {
1212
description = "The ID of the Cloudwatch metric alarm"
13-
value = module.alarm.this_cloudwatch_metric_alarm_id
13+
value = module.alarm.cloudwatch_metric_alarm_id
1414
}

examples/fixtures/aws_cloudwatch_log_group/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ output "random_id" {
33
value = random_pet.this.id
44
}
55

6-
output "this_cloudwatch_log_group_arn" {
6+
output "cloudwatch_log_group_arn" {
77
description = "ARN"
88
value = aws_cloudwatch_log_group.this.arn
99
}
1010

11-
output "this_cloudwatch_log_group_name" {
11+
output "cloudwatch_log_group_name" {
1212
description = "Name"
1313
value = aws_cloudwatch_log_group.this.name
1414
}

examples/fixtures/aws_kms_key/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ resource "random_pet" "this" {
44

55
resource "aws_kms_key" "this" {
66
description = "fixtures-${random_pet.this.id}"
7-
87
}

0 commit comments

Comments
 (0)