Skip to content

Commit 6e5ede6

Browse files
committed
moving to new format
1 parent e32289d commit 6e5ede6

File tree

15 files changed

+159
-114
lines changed

15 files changed

+159
-114
lines changed

.github/workflows/security_scans.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Security Scans
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
paths-ignore:
9+
- 'README.md'
10+
- 'LICENSE'
11+
- '.gitignore'
12+
- '**.md'
13+
pull_request:
14+
paths-ignore:
15+
- 'README.md'
16+
- 'LICENSE'
17+
- '.gitignore'
18+
- '**.md'
19+
20+
jobs:
21+
scans:
22+
name: Security Scans
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Checkov Scan
28+
id: checkov
29+
uses: bridgecrewio/checkov-action@master
30+
with:
31+
directory: "."
32+
framework: terraform # optional: run only on a specific infrastructure {cloudformation,terraform,kubernetes,all}
33+
output_format: json # optional: the output format, one of: cli, json, junitxml, github_failed_only

README.md

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1-
[![](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
2-
3-
# terraform-aws-target-group
4-
Terraform module for Target Group
1+
<p align="center">
2+
<a href="https://github.com/tomarv2/terraform-aws-target-group/actions/workflows/security_scans.yml" alt="Security Scans">
3+
<img src="https://github.com/tomarv2/terraform-aws-target-group/actions/workflows/security_scans.yml/badge.svg?branch=main" /></a>
4+
<a href="https://www.apache.org/licenses/LICENSE-2.0" alt="license">
5+
<img src="https://img.shields.io/github/license/tomarv2/terraform-aws-target-group" /></a>
6+
<a href="https://github.com/tomarv2/terraform-aws-target-group/tags" alt="GitHub tag">
7+
<img src="https://img.shields.io/github/v/tag/tomarv2/terraform-aws-target-group" /></a>
8+
<a href="https://github.com/tomarv2/terraform-aws-target-group/pulse" alt="Activity">
9+
<img src="https://img.shields.io/github/commit-activity/m/tomarv2/terraform-aws-target-group" /></a>
10+
<a href="https://stackoverflow.com/users/6679867/tomarv2" alt="Stack Exchange reputation">
11+
<img src="https://img.shields.io/stackexchange/stackoverflow/r/6679867"></a>
12+
<a href="https://discord.gg/XH975bzN" alt="chat on Discord">
13+
<img src="https://img.shields.io/discord/813961944443912223?logo=discord"></a>
14+
<a href="https://twitter.com/intent/follow?screen_name=varuntomar2019" alt="follow on Twitter">
15+
<img src="https://img.shields.io/twitter/follow/varuntomar2019?style=social&logo=twitter"></a>
16+
</p>
17+
18+
# Terraform module for AWS Target Group
519

620
## Versions
721

822
- Module tested for Terraform 0.14.
923
- AWS provider version [3.29.0](https://registry.terraform.io/providers/hashicorp/aws/latest)
1024
- `main` branch: Provider versions not pinned to keep up with Terraform releases
11-
- `tags` releases: Tags are pinned with versions (use latest tag in your releases)
25+
- `tags` releases: Tags are pinned with versions (use latest
26+
<a href="https://github.com/tomarv2/terraform-aws-target-group/tags" alt="GitHub tag">
27+
<img src="https://img.shields.io/github/v/tag/tomarv2/terraform-aws-target-group" /></a>
28+
in your releases)
1229

1330
**NOTE:**
1431

@@ -33,18 +50,9 @@ pip install tfremote
3350
export TF_AWS_BUCKET=<remote state bucket name>
3451
export TF_AWS_PROFILE=default
3552
export TF_AWS_BUCKET_REGION=us-west-2
36-
export PATH=$PATH:/usr/local/bin/
3753
```
3854

39-
- Update:
40-
```
41-
example/custom/sample.tfvars
42-
```
43-
44-
- Change to:
45-
```
46-
example/base
47-
```
55+
- Updated `examples` directory with required values
4856

4957
- Run and verify the output before deploying:
5058
```
@@ -61,7 +69,43 @@ tf -cloud aws apply -var-file <path to .tfvars file>
6169
tf -cloud aws destroy -var-file <path to .tfvars file>
6270
```
6371

64-
Please refer to example directory [link](example/README.md) for references.
72+
> ❗️ **Important** - Two variables are required for using `tf` package:
73+
>
74+
> - teamid
75+
> - prjid
76+
>
77+
> These variables are required to set backend path in the remote storage.
78+
> Variables can be defined using:
79+
>
80+
> - As `inline variables` e.g.: `-var='teamid=demo-team' -var='prjid=demo-project'`
81+
> - Inside `.tfvars` file e.g.: `-var-file=<tfvars file location> `
82+
>
83+
> For more information refer to [Terraform documentation](https://www.terraform.io/docs/language/values/variables.html)
84+
85+
##### Target Group
86+
```
87+
module "target_group" {
88+
source = "../"
89+
90+
email = "demo@demo.com"
91+
account_id = "12345679012"
92+
lb_protocol = "HTTP"
93+
lb_port = [80]
94+
healthcheck_path = "/"
95+
healthy_threshold = "2"
96+
healthcheck_matcher = "200"
97+
healthcheck_timeout = "15"
98+
unhealthy_threshold = "3"
99+
healthcheck_interval = "30"
100+
#-----------------------------------------------
101+
# Note: Do not change teamid and prjid once set.
102+
teamid = var.teamid
103+
prjid = var.prjid
104+
}
105+
106+
```
107+
108+
Please refer to examples directory [link](examples) for references.
65109

66110
## Inputs
67111

example/README.md

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

example/base/output.tf

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

example/base/target_group.tf

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

example/custom/sample.tfvars

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

examples/main.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module "target_group" {
2+
source = "../"
3+
4+
email = "demo@demo.com"
5+
account_id = "12345679012"
6+
lb_protocol = "HTTP"
7+
lb_port = [80]
8+
healthcheck_path = "/"
9+
healthy_threshold = "2"
10+
healthcheck_matcher = "200"
11+
healthcheck_timeout = "15"
12+
unhealthy_threshold = "3"
13+
healthcheck_interval = "30"
14+
#-----------------------------------------------
15+
# Note: Do not change teamid and prjid once set.
16+
teamid = var.teamid
17+
prjid = var.prjid
18+
}

examples/output.tf

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

example/base/remote_backend.tf renamed to examples/remote_backend.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# do not edit or delete!
33

44
terraform {
5-
backend "s3" {
6-
}
5+
backend "s3" {
6+
}
77
}

examples/sample.tfvars

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
email = "demo@demo.com"
2+
service_ports = ["22", "80", "443", "5432", "8000"]
3+
profile_to_use = "default"
4+
account_id = "12345679012"
5+
6+
# ------------------------------------------------------------------
7+
# Note: Do not change teamid and prjid once set.
8+
teamid = "rumse"
9+
prjid = "demo-target-group"
10+

0 commit comments

Comments
 (0)