Skip to content

Commit a404a62

Browse files
committed
fix: remove unused variables and update linting checks to ensure this is caught in the future
1 parent 73b09a1 commit a404a62

File tree

12 files changed

+47
-22
lines changed

12 files changed

+47
-22
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,25 @@ repos:
33
rev: v1.56.0
44
hooks:
55
- id: terraform_fmt
6+
- id: terraform_validate
67
- id: terraform_docs
78
args:
89
- '--args=--lockfile=false'
9-
- id: terraform_validate
1010
- id: terraform_tflint
11+
args:
12+
- '--args=--only=terraform_deprecated_interpolation'
13+
- '--args=--only=terraform_deprecated_index'
14+
- '--args=--only=terraform_unused_declarations'
15+
- '--args=--only=terraform_comment_syntax'
16+
- '--args=--only=terraform_documented_outputs'
17+
- '--args=--only=terraform_documented_variables'
18+
- '--args=--only=terraform_typed_variables'
19+
- '--args=--only=terraform_module_pinned_source'
20+
- '--args=--only=terraform_naming_convention'
21+
- '--args=--only=terraform_required_version'
22+
- '--args=--only=terraform_required_providers'
23+
- '--args=--only=terraform_standard_module_structure'
24+
- '--args=--only=terraform_workspace_remote'
1125
- repo: https://github.com/pre-commit/pre-commit-hooks
1226
rev: v4.0.1
1327
hooks:

examples/complete/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ Note that this example may create resources which will incur monetary charges on
2323

2424
| Name | Version |
2525
|------|---------|
26-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
26+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
2727
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
28+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2829

2930
## Providers
3031

3132
| Name | Version |
3233
|------|---------|
3334
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
34-
| <a name="provider_random"></a> [random](#provider\_random) | n/a |
35+
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3536

3637
## Modules
3738

@@ -56,7 +57,6 @@ Note that this example may create resources which will incur monetary charges on
5657
| [aws_iam_policy_document.custom](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
5758
| [aws_iam_policy_document.datadog_cmk](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
5859
| [aws_secretsmanager_secret.datadog_api_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/secretsmanager_secret) | data source |
59-
| [aws_secretsmanager_secret_version.datadog_api_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/secretsmanager_secret_version) | data source |
6060

6161
## Inputs
6262

examples/complete/main.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ data "aws_secretsmanager_secret" "datadog_api_key" {
2222
name = "datadog/api_key"
2323
}
2424

25-
data "aws_secretsmanager_secret_version" "datadog_api_key" {
26-
secret_id = data.aws_secretsmanager_secret.datadog_api_key.id
27-
}
28-
2925
data "aws_caller_identity" "current" {}
3026

3127
################################################################################

examples/complete/variables.tf

Whitespace-only changes.

examples/complete/versions.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
terraform {
2-
required_version = ">= 0.12.26"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.0"
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 3.0"
8+
}
9+
random = {
10+
source = "hashicorp/random"
11+
version = ">= 2.0"
12+
}
613
}
714
}

examples/simple/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ Note that this example may create resources which will incur monetary charges on
1919

2020
| Name | Version |
2121
|------|---------|
22-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 |
22+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
2323
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
24+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |
2425

2526
## Providers
2627

2728
| Name | Version |
2829
|------|---------|
2930
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
30-
| <a name="provider_random"></a> [random](#provider\_random) | n/a |
31+
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |
3132

3233
## Modules
3334

examples/simple/variables.tf

Whitespace-only changes.

examples/simple/versions.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
terraform {
2-
required_version = ">= 0.12.26"
2+
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.0"
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 3.0"
8+
}
9+
random = {
10+
source = "hashicorp/random"
11+
version = ">= 2.0"
12+
}
613
}
714
}

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ module "vpc_flow_log_forwarder" {
142142
policy_name = var.vpc_fl_forwarder_policy_name
143143
use_policy_name_prefix = var.vpc_fl_forwarder_use_policy_name_prefix
144144
policy_path = var.vpc_fl_forwarder_policy_path
145+
s3_log_bucket_arns = var.vpc_fl_forwarder_s3_log_bucket_arns
146+
read_cloudwatch_logs = var.vpc_fl_forwarder_read_cloudwatch_logs
145147

146148
tags = merge(var.tags, var.vpc_fl_forwarder_tags)
147149
}

modules/log_forwarder/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ module "datadog_log_forwarder" {
4343
|------|---------|
4444
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
4545
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
46+
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.0 |
4647

4748
## Providers
4849

4950
| Name | Version |
5051
|------|---------|
5152
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
52-
| <a name="provider_null"></a> [null](#provider\_null) | n/a |
53+
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.0 |
5354

5455
## Modules
5556

@@ -100,7 +101,6 @@ module "datadog_log_forwarder" {
100101
| <a name="input_policy_name"></a> [policy\_name](#input\_policy\_name) | Forwarder policy name | `string` | `""` | no |
101102
| <a name="input_policy_path"></a> [policy\_path](#input\_policy\_path) | Forwarder policy path | `string` | `null` | no |
102103
| <a name="input_publish"></a> [publish](#input\_publish) | Whether to publish creation/change as a new Lambda Function Version | `bool` | `false` | no |
103-
| <a name="input_read_cloudwatch_logs"></a> [read\_cloudwatch\_logs](#input\_read\_cloudwatch\_logs) | Whether the forwarder will read logs from CloudWatch or not | `bool` | `false` | no |
104104
| <a name="input_reserved_concurrent_executions"></a> [reserved\_concurrent\_executions](#input\_reserved\_concurrent\_executions) | The amount of reserved concurrent executions for the forwarder lambda function | `number` | `100` | no |
105105
| <a name="input_role_arn"></a> [role\_arn](#input\_role\_arn) | IAM role arn for forwarder lambda function to utilize | `string` | `null` | no |
106106
| <a name="input_role_max_session_duration"></a> [role\_max\_session\_duration](#input\_role\_max\_session\_duration) | The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours | `number` | `null` | no |

0 commit comments

Comments
 (0)