Skip to content

Commit

Permalink
Fix target group length (#74)
Browse files Browse the repository at this point in the history
* Fix target group length

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix readme

* Fix context source

* Rebuild README

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
goruha and github-actions[bot] authored Aug 8, 2023
1 parent 6e32f47 commit 0f8ef73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ We highly recommend that in your code you pin the version to the exact version y
using so that your infrastructure remains stable, and update versions in a
systematic way so that they do not catch you by surprise.

Also, because of a bug in the Terraform registry ([hashicorp/terraform#21417](https://github.com/hashicorp/terraform/issues/21417)),
the registry shows many of our inputs as required when in fact they are optional.
The table below correctly indicates which inputs are required.


For a complete example, see [examples/complete](examples/complete).

Expand Down Expand Up @@ -233,6 +229,7 @@ Available targets:

| Name | Source | Version |
|------|--------|---------|
| <a name="module_target_group"></a> [target\_group](#module\_target\_group) | cloudposse/label/null | 0.25.0 |
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |

## Resources
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

| Name | Source | Version |
|------|--------|---------|
| <a name="module_target_group"></a> [target\_group](#module\_target\_group) | cloudposse/label/null | 0.25.0 |
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |

## Resources
Expand Down
9 changes: 8 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ data "aws_lb_target_group" "default" {
arn = local.target_group_arn
}

module "target_group" {
source = "cloudposse/label/null"
version = "0.25.0"
id_length_limit = 32
context = module.this.context
}

resource "aws_lb_target_group" "default" {
count = module.this.enabled && var.default_target_group_enabled ? 1 : 0

name = coalesce(var.target_group_name, module.this.id)
name = coalesce(var.target_group_name, module.target_group.id)
port = var.port
protocol = var.protocol
protocol_version = var.protocol_version
Expand Down

0 comments on commit 0f8ef73

Please sign in to comment.