1
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>
2
+ <a href="https://github.com/tomarv2/terraform-aws-target-group/actions/workflows/pre-commit .yml" alt="Pre commit ">
3
+ <img src="https://github.com/tomarv2/terraform-aws-target-group/actions/workflows/pre-commit .yml/badge.svg?branch=main" /></a>
4
4
<a href="https://www.apache.org/licenses/LICENSE-2.0" alt="license">
5
5
<img src="https://img.shields.io/github/license/tomarv2/terraform-aws-target-group" /></a>
6
6
<a href="https://github.com/tomarv2/terraform-aws-target-group/tags" alt="GitHub tag">
19
19
20
20
## Versions
21
21
22
- - Module tested for Terraform 0.14 .
23
- - AWS provider version [ 3.29 .0] ( https://registry.terraform.io/providers/hashicorp/aws/latest )
24
- - ` main ` branch: Provider versions not pinned to keep up with Terraform releases
22
+ - Module tested for Terraform 1.0.1 .
23
+ - AWS provider version [ 3.47 .0] ( https://registry.terraform.io/providers/hashicorp/aws/latest )
24
+ - ` main ` branch: Provider versions not pinned to keep up with Terraform releases.
25
25
- ` tags ` releases: Tags are pinned with versions (use <a href =" https://github.com/tomarv2/terraform-aws-target-group/tags " alt =" GitHub tag " >
26
- <img src =" https://img.shields.io/github/v/tag/tomarv2/terraform-aws-target-group " /></a > in your releases)
26
+ <img src =" https://img.shields.io/github/v/tag/tomarv2/terraform-aws-target-group " /></a > ).
27
27
28
- ** NOTE:**
28
+ ---
29
+ ## Usage
29
30
30
- - Read more on [ tfremote ] ( https://github.com/tomarv2/tfremote )
31
+ ### Option 1:
31
32
32
- ## Usage
33
+ ```
34
+ terrafrom init
35
+ terraform plan -var='teamid=tryme' -var='prjid=project1'
36
+ terraform apply -var='teamid=tryme' -var='prjid=project1'
37
+ terraform destroy -var='teamid=tryme' -var='prjid=project1'
38
+ ```
39
+ ** Note:** With this option please take care of remote state storage
33
40
34
- Recommended method :
41
+ ### Option 2 :
35
42
36
- - Create python 3.6+ virtual environment
43
+ #### Recommended method (store remote state in S3 using prjid and teamid to create directory structure):
44
+
45
+ - Create python 3.6+ virtual environment
37
46
```
38
47
python3 -m venv <venv name>
39
48
```
40
49
41
50
- Install package:
42
51
```
43
- pip install tfremote
52
+ pip install tfremote --upgrade
53
+ ```
54
+
55
+ - Set below environment variables:
56
+ ```
57
+ export TF_AWS_BUCKET=<remote state bucket name>
58
+ export TF_AWS_BUCKET_REGION=us-west-2
59
+ export TF_AWS_PROFILE=<profile from ~/.ws/credentials>
44
60
```
45
61
62
+ or
63
+
46
64
- Set below environment variables:
47
65
```
48
66
export TF_AWS_BUCKET=<remote state bucket name>
49
- export TF_AWS_PROFILE=default
50
67
export TF_AWS_BUCKET_REGION=us-west-2
51
- ```
68
+ export AWS_ACCESS_KEY_ID=<aws_access_key_id>
69
+ export AWS_SECRET_ACCESS_KEY=<aws_secret_access_key>
70
+ ```
52
71
53
- - Updated ` examples ` directory with required values.
72
+ - Updated ` examples ` directory with required values.
54
73
55
74
- Run and verify the output before deploying:
56
75
```
57
- tf -cloud aws plan -var='teamid=foo' -var='prjid=bar'
76
+ tf -c= aws plan -var='teamid=foo' -var='prjid=bar'
58
77
```
59
78
60
79
- Run below to deploy:
61
80
```
62
- tf -cloud aws apply -var='teamid=foo' -var='prjid=bar'
81
+ tf -c= aws apply -var='teamid=foo' -var='prjid=bar'
63
82
```
64
83
65
84
- Run below to destroy:
66
85
```
67
- tf -cloud aws destroy -var='teamid=foo' -var='prjid=bar'
86
+ tf -c= aws destroy -var='teamid=foo' -var='prjid=bar'
68
87
```
69
88
70
- > ❗️ ** Important** - Two variables are required for using ` tf ` package:
71
- >
72
- > - teamid
73
- > - prjid
74
- >
75
- > These variables are required to set backend path in the remote storage.
76
- > Variables can be defined using:
77
- >
78
- > - As ` inline variables ` e.g.: ` -var='teamid=demo-team' -var='prjid=demo-project' `
79
- > - Inside ` .tfvars ` file e.g.: ` -var-file=<tfvars file location> `
80
- >
81
- > For more information refer to [ Terraform documentation] ( https://www.terraform.io/docs/language/values/variables.html )
89
+ ** NOTE:**
90
+
91
+ - Read more on [ tfremote] ( https://github.com/tomarv2/tfremote )
92
+ ---
93
+
94
+ Please refer to examples directory [ link] ( examples ) for references.
82
95
83
96
##### Target Group
84
97
```
@@ -99,50 +112,6 @@ module "target_group" {
99
112
teamid = var.teamid
100
113
prjid = var.prjid
101
114
}
102
-
103
115
```
104
116
105
117
Please refer to examples directory [ link] ( examples ) for references.
106
-
107
- ## Requirements
108
-
109
- | Name | Version |
110
- | ------| ---------|
111
- | terraform | >= 0.14 |
112
- | aws | ~ > 3.29 |
113
-
114
- ## Providers
115
-
116
- | Name | Version |
117
- | ------| ---------|
118
- | aws | ~ > 3.29 |
119
-
120
- ## Inputs
121
-
122
- | Name | Description | Type | Default | Required |
123
- | ------| -------------| ------| ---------| :--------:|
124
- | account\_ id | (Required) AWS account id (used to pull values from shared base module like vpc info, subnet ids) | ` any ` | n/a | yes |
125
- | alb\_ action\_ type | n/a | ` string ` | ` "forward" ` | no |
126
- | alb\_ cert\_ arn | alb cert arn | ` string ` | ` "" ` | no |
127
- | alb\_ ssl\_ policy | alb ssl policy | ` string ` | ` "" ` | no |
128
- | aws\_ region | The AWS region to create resources | ` string ` | ` "us-west-2" ` | no |
129
- | deregistration\_ delay | n/a | ` string ` | ` "300" ` | no |
130
- | healthcheck\_ interval | n/a | ` string ` | ` "" ` | no |
131
- | healthcheck\_ matcher | healthcheck matcher (e.g. 200) | ` string ` | ` "" ` | no |
132
- | healthcheck\_ path | target group healthcheck path | ` string ` | ` "" ` | no |
133
- | healthcheck\_ timeout | n/a | ` string ` | ` "" ` | no |
134
- | healthy\_ threshold | target group healthcheck threshold | ` string ` | ` "" ` | no |
135
- | lb\_ port | n/a | ` list ` | <pre >[ <br > 80<br >] </pre > | no |
136
- | lb\_ protocol | n/a | ` string ` | ` "HTTP" ` | no |
137
- | prjid | (Required) Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply' | ` any ` | n/a | yes |
138
- | profile\_ to\_ use | Getting values from ~ /.aws/credentials | ` string ` | ` "default" ` | no |
139
- | stickiness | Target group sticky configuration | <pre >object({<br > cookie_duration = number<br > enabled = bool<br > })</pre > | ` null ` | no |
140
- | target\_ type | n/a | ` string ` | ` "instance" ` | no |
141
- | teamid | (Required) Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply' | ` any ` | n/a | yes |
142
- | unhealthy\_ threshold | target group unheathy healthcheck threshold | ` string ` | ` "" ` | no |
143
-
144
- ## Outputs
145
-
146
- | Name | Description |
147
- | ------| -------------|
148
- | target\_ group\_ arn | n/a |
0 commit comments