Skip to content

Commit bb6c5f5

Browse files
committed
cleanup
1 parent 2e12a31 commit bb6c5f5

File tree

8 files changed

+68
-50
lines changed

8 files changed

+68
-50
lines changed

.github/workflows/onrelease.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ on:
77
name: release
88

99
jobs:
10+
generate-changelog:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- uses: BobAnkh/auto-generate-changelog@master
17+
with:
18+
REPO_NAME: ''
19+
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
20+
BRANCH: ''
21+
PATH: 'CHANGELOG.md'
22+
COMMIT_MESSAGE: 'docs(CHANGELOG): update release notes'
23+
TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'
1024
build:
1125
name: Create Release
1226
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ repos:
1414
- '--args=--only=terraform_typed_variables'
1515
- '--args=--only=terraform_module_pinned_source'
1616
- '--args=--only=terraform_naming_convention'
17-
#- '--args=--only=terraform_required_providers'
1817
- '--args=--only=terraform_standard_module_structure' #
1918
- '--args=--only=terraform_workspace_remote'
2019

README.md

Lines changed: 1 addition & 1 deletion
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.61.0](https://registry.terraform.io/providers/hashicorp/aws/latest)
23+
- AWS provider version [3.63](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> ).

locals.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module "global" {
2+
source = "git::git@github.com:tomarv2/terraform-global.git//aws?ref=v0.0.1"
3+
}
4+
5+
locals {
6+
shared_tags = tomap(
7+
{
8+
"Name" = "${var.teamid}-${var.prjid}",
9+
"team" = var.teamid,
10+
"project" = var.prjid
11+
}
12+
)
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
15+
}
16+
17+
data "aws_region" "current" {}
18+
19+
data "aws_caller_identity" "current" {}

main.tf

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
module "global" {
2-
source = "git::git@github.com:tomarv2/terraform-global.git//aws?ref=v0.0.1"
3-
}
1+
# target group
2+
# https://github.com/cloudposse/terraform-aws-alb-ingress/issues/24
3+
resource "aws_lb_target_group" "target_group" {
4+
count = var.deploy_target_group != false ? length(var.lb_port) : 0
5+
6+
7+
name = "${var.teamid}-${var.prjid}-${var.lb_port[count.index]}"
8+
port = element(var.lb_port, count.index)
9+
protocol = var.lb_protocol
10+
11+
vpc_id = module.global.vpc[local.account_info][local.override_aws_region]
12+
tags = merge(local.shared_tags)
13+
14+
deregistration_delay = var.deregistration_delay
15+
target_type = var.target_type
16+
17+
health_check {
18+
interval = var.healthcheck_interval == "" ? null : var.healthcheck_interval
19+
path = var.healthcheck_path == "" ? null : var.healthcheck_path
20+
healthy_threshold = var.healthy_threshold == "" ? null : var.healthy_threshold
21+
unhealthy_threshold = var.unhealthy_threshold == "" ? null : var.unhealthy_threshold
22+
timeout = var.healthcheck_timeout == "" ? null : var.healthcheck_timeout
23+
protocol = var.lb_protocol == "" ? null : var.lb_protocol
24+
matcher = var.healthcheck_matcher == "" ? null : var.healthcheck_matcher
25+
}
426

5-
locals {
6-
shared_tags = tomap(
7-
{
8-
"Name" = "${var.teamid}-${var.prjid}",
9-
"team" = var.teamid,
10-
"project" = var.prjid
27+
dynamic "stickiness" {
28+
for_each = var.stickiness == null ? [] : [var.stickiness]
29+
content {
30+
type = "lb_cookie"
31+
cookie_duration = stickiness.value.cookie_duration
32+
enabled = var.lb_protocol == "TCP" ? false : stickiness.value.enabled
1133
}
12-
)
34+
}
1335
}

target_group.tf

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

variables.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ variable "prjid" {
1010

1111
variable "aws_region" {
1212
description = "The AWS region to create resources"
13-
default = "us-west-2"
1413
type = string
1514
}
1615

1716
variable "account_id" {
18-
description = "(Required) AWS account id (used to pull values from shared base module like vpc info, subnet ids)"
17+
description = "AWS account id (used to pull values from shared base module like vpc info, subnet ids)"
1918
type = string
2019
}
2120

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

0 commit comments

Comments
 (0)