Skip to content

Commit 2e12a31

Browse files
committed
adding feature flag
1 parent b99fa52 commit 2e12a31

File tree

8 files changed

+16
-20
lines changed

8 files changed

+16
-20
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ repos:
33
rev: v1.48.0
44
hooks:
55
- id: terraform_fmt
6-
#- id: terraform_validate
76
- id: terraform_tflint
87
args:
98
- '--args=--only=terraform_deprecated_interpolation'
@@ -28,9 +27,8 @@ repos:
2827
- id: check-yaml
2928

3029
- repo: https://github.com/bridgecrewio/checkov.git
31-
rev: '1.0.864' # change to tag or sha
30+
rev: '2.0.469'
3231
hooks:
3332
- id: checkov
3433
verbose: true
35-
args:
36-
- -d . --framework terraform -o output_format json
34+
args: [-d, '.', --framework,'terraform', --skip-check, 'CKV_AWS_158']

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
## Versions
2121

2222
- Module tested for Terraform 1.0.1.
23-
- AWS provider version [3.47.0](https://registry.terraform.io/providers/hashicorp/aws/latest)
23+
- AWS provider version [3.61.0](https://registry.terraform.io/providers/hashicorp/aws/latest)
2424
- `main` branch: Provider versions not pinned to keep up with Terraform releases.
2525
- `tags` releases: Tags are pinned with versions (use <a href="https://github.com/tomarv2/terraform-aws-target-group/tags" alt="GitHub tag">
2626
<img src="https://img.shields.io/github/v/tag/tomarv2/terraform-aws-target-group" /></a> ).
@@ -42,7 +42,7 @@ terraform destroy -var='teamid=tryme' -var='prjid=project1'
4242

4343
#### Recommended method (store remote state in S3 using prjid and teamid to create directory structure):
4444

45-
- Create python 3.6+ virtual environment
45+
- Create python 3.8+ virtual environment
4646
```
4747
python3 -m venv <venv name>
4848
```
@@ -91,8 +91,6 @@ tf -c=aws destroy -var='teamid=foo' -var='prjid=bar'
9191
- Read more on [tfremote](https://github.com/tomarv2/tfremote)
9292
---
9393

94-
Please refer to examples directory [link](examples) for references.
95-
9694
##### Target Group
9795
```
9896
module "target_group" {

examples/sample/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
output "target_groupn_arn" {
2-
description = "The arn of the target group"
1+
output "target_group_arn" {
2+
description = "Target group arn"
33
value = module.target_group.target_group_arn
44
}

examples/sample/remote_backend.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
output "target_group_arn" {
2-
description = "The arn of the target group"
2+
description = "Target group arn"
33
value = aws_lb_target_group.target_group.*.arn
44
}

target_group.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# target group
22
# https://github.com/cloudposse/terraform-aws-alb-ingress/issues/24
33
resource "aws_lb_target_group" "target_group" {
4-
count = length(var.lb_port)
4+
count = var.deploy_target_group != false ? length(var.lb_port) : 0
5+
56

67
name = "${var.teamid}-${var.prjid}-${var.lb_port[count.index]}"
78
port = element(var.lb_port, count.index)

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,9 @@ variable "target_type" {
105105
default = "instance"
106106
type = string
107107
}
108+
109+
variable "deploy_target_group" {
110+
description = "feature flag, true or false"
111+
default = true
112+
type = bool
113+
}

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.47"
5+
version = ">= 3.61"
66
}
77
}
88
}

0 commit comments

Comments
 (0)