Skip to content

Commit dc4bebe

Browse files
committed
removing dependencies
1 parent 3ad3c99 commit dc4bebe

File tree

8 files changed

+88
-28
lines changed

8 files changed

+88
-28
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.48.0
3+
rev: v1.60.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_tflint
77
args:
88
- '--args=--only=terraform_deprecated_interpolation'
99
- '--args=--only=terraform_deprecated_index'
10-
- '--args=--only=terraform_unused_declarations' #
10+
- '--args=--only=terraform_unused_declarations'
1111
- '--args=--only=terraform_comment_syntax'
1212
- '--args=--only=terraform_documented_outputs'
1313
- '--args=--only=terraform_documented_variables'
1414
- '--args=--only=terraform_typed_variables'
1515
- '--args=--only=terraform_module_pinned_source'
1616
- '--args=--only=terraform_naming_convention'
17-
- '--args=--only=terraform_standard_module_structure' #
17+
- '--args=--only=terraform_required_providers'
18+
- '--args=--only=terraform_standard_module_structure'
1819
- '--args=--only=terraform_workspace_remote'
1920

2021
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v3.2.0
22+
rev: v4.1.0
2223
hooks:
2324
- id: trailing-whitespace
24-
- id: check-merge-conflict
2525
- id: end-of-file-fixer
26+
- id: check-docstring-first
2627
- id: check-yaml
28+
- id: debug-statements
29+
- id: double-quote-string-fixer
30+
- id: name-tests-test
31+
- id: requirements-txt-fixer
2732

2833
- repo: https://github.com/bridgecrewio/checkov.git
29-
rev: '2.0.469'
34+
rev: '2.0.914'
3035
hooks:
3136
- id: checkov
3237
verbose: true
33-
args: [-d, '.', --framework,'terraform', --skip-check, 'CKV_AWS_158']
38+
args: [-d, '.', --framework,'terraform', --skip-check, 'CKV_AWS_158', --download-external-modules, 'True']

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,55 @@ module "target_group" {
111111
```
112112

113113
Please refer to examples directory [link](examples) for references.
114+
115+
## Requirements
116+
117+
| Name | Version |
118+
|------|---------|
119+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.1 |
120+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.63 |
121+
122+
## Providers
123+
124+
| Name | Version |
125+
|------|---------|
126+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.47.0 |
127+
128+
## Modules
129+
130+
| Name | Source | Version |
131+
|------|--------|---------|
132+
| <a name="module_global"></a> [global](#module\_global) | git::git@github.com:tomarv2/terraform-global.git//aws | v0.0.1 |
133+
134+
## Resources
135+
136+
| Name | Type |
137+
|------|------|
138+
| [aws_lb_target_group.target_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group) | resource |
139+
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
140+
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
141+
142+
## Inputs
143+
144+
| Name | Description | Type | Default | Required |
145+
|------|-------------|------|---------|:--------:|
146+
| <a name="input_deploy_target_group"></a> [deploy\_target\_group](#input\_deploy\_target\_group) | feature flag, true or false | `bool` | `true` | no |
147+
| <a name="input_deregistration_delay"></a> [deregistration\_delay](#input\_deregistration\_delay) | deregistration delay | `string` | `"300"` | no |
148+
| <a name="input_healthcheck_interval"></a> [healthcheck\_interval](#input\_healthcheck\_interval) | health check interval | `string` | `""` | no |
149+
| <a name="input_healthcheck_matcher"></a> [healthcheck\_matcher](#input\_healthcheck\_matcher) | healthcheck matcher (e.g. 200) | `string` | `""` | no |
150+
| <a name="input_healthcheck_path"></a> [healthcheck\_path](#input\_healthcheck\_path) | target group health check path | `string` | `""` | no |
151+
| <a name="input_healthcheck_timeout"></a> [healthcheck\_timeout](#input\_healthcheck\_timeout) | health check timeout | `string` | `""` | no |
152+
| <a name="input_healthy_threshold"></a> [healthy\_threshold](#input\_healthy\_threshold) | target group health check threshold | `string` | `""` | no |
153+
| <a name="input_lb_port"></a> [lb\_port](#input\_lb\_port) | load balancer port | `list(any)` | <pre>[<br> 80<br>]</pre> | no |
154+
| <a name="input_lb_protocol"></a> [lb\_protocol](#input\_lb\_protocol) | load balancer protocol | `string` | `"HTTP"` | no |
155+
| <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 |
156+
| <a name="input_stickiness"></a> [stickiness](#input\_stickiness) | Target group sticky configuration | <pre>object({<br> cookie_duration = number<br> enabled = bool<br> })</pre> | `null` | no |
157+
| <a name="input_target_type"></a> [target\_type](#input\_target\_type) | target type | `string` | `"instance"` | no |
158+
| <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 |
159+
| <a name="input_unhealthy_threshold"></a> [unhealthy\_threshold](#input\_unhealthy\_threshold) | target group unhealthy health check threshold | `string` | `""` | no |
160+
161+
## Outputs
162+
163+
| Name | Description |
164+
|------|-------------|
165+
| <a name="output_target_group_arn"></a> [target\_group\_arn](#output\_target\_group\_arn) | Target group arn |

examples/sample/main.tf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
terraform {
2+
required_version = ">= 1.0.1"
3+
required_providers {
4+
aws = {
5+
version = "~> 3.63"
6+
}
7+
}
8+
}
9+
110
provider "aws" {
2-
region = "us-west-2"
3-
profile = "default"
11+
region = var.region
412
}
513

614
module "target_group" {
715
source = "../../"
816

9-
account_id = "12345679012"
1017
lb_protocol = "HTTP"
1118
lb_port = [80]
1219
healthcheck_path = "/"

examples/sample/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
variable "teamid" {
2-
description = "(Required) Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply'"
2+
description = "Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply'"
33
type = string
44
}
55

66
variable "prjid" {
7-
description = "(Required) Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply'"
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 "region" {
12+
description = "AWS region to create resources"
13+
default = "us-west-2"
814
type = string
915
}

locals.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ locals {
1010
"project" = var.prjid
1111
}
1212
)
13-
account_info = var.account_id != null ? var.account_id : data.aws_caller_identity.current.account_id
14-
override_aws_region = var.aws_region != null ? var.aws_region : data.aws_region.current.name
13+
account_id = data.aws_caller_identity.current.account_id
14+
region = data.aws_region.current.name
1515
}
1616

1717
data "aws_region" "current" {}

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "aws_lb_target_group" "target_group" {
88
port = element(var.lb_port, count.index)
99
protocol = var.lb_protocol
1010

11-
vpc_id = module.global.vpc[local.account_info][local.override_aws_region]
11+
vpc_id = module.global.vpc[local.account_id][local.region]
1212
tags = merge(local.shared_tags)
1313

1414
deregistration_delay = var.deregistration_delay

variables.tf

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
variable "teamid" {
2-
description = "(Required) Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply'"
2+
description = "Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply'"
33
type = string
44
}
55

66
variable "prjid" {
7-
description = "(Required) 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 "aws_region" {
12-
description = "The AWS region to create resources"
13-
type = string
14-
}
15-
16-
variable "account_id" {
17-
description = "AWS account id (used to pull values from shared base module like vpc info, subnet ids)"
7+
description = "Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply'"
188
type = string
199
}
2010

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 1.0.1"
33
required_providers {
44
aws = {
5-
version = ">= 3.63"
5+
version = "~> 3.63"
66
}
77
}
88
}

0 commit comments

Comments
 (0)