hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.63k stars 9.01k forks source link

[Enhancement]: resource: aws_lb_target_group - Automatic Target Weights (ATW) #34644

Closed cwilliams-intelerad closed 6 months ago

cwilliams-intelerad commented 7 months ago

Description

AWS load balancer target groups now have an automatic target weights (AWT) feature that added an allow a load balance type algorithm of "weighed random" with anomaly mitigation. I would like the feature to be supported in the aws_lb_target_group resource.

Affected Resource(s) and/or Data Source(s)

aws_lb_target_group

Potential Terraform Configuration

resource "aws_lb_target_group" "alb-example" {
  name        = "tf-example-lb-alb-tg"
  port                          = 80
  protocol                      = "TCP"
  vpc_id                        = aws_vpc.main.id
  load_balancing_algorithm_type = "weighted_random"
  anomaly_mitigation            = true
}

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 7 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

nitrocode commented 7 months ago

Reference https://aws.amazon.com/about-aws/whats-new/2023/11/application-load-balancer-availability-target-weights/

bclodius commented 6 months ago

@ewbankkit is Hashicorp open to contributions for this?

Edit: I would be interested in implementing this enhancement if its still open.

ewbankkit commented 6 months ago

@bclodius All contributions always welcome 🎅. This issue has not be claimed.

bclodius commented 6 months ago

@ewbankkit I'd like to claim this! Will take it up next week 🙏 .

bclodius commented 6 months ago

I'm making a good progress on a PR. Should have something up Thursday December 28th.

bclodius commented 6 months ago

@cwilliams-intelerad @nitrocode FYI I've raised a PR here https://github.com/hashicorp/terraform-provider-aws/pull/35083

I opted to implement load_balancing_anomaly_mitigation with values on and off since that's what the AWS API supports. I don't know why AWS didn't choose to just support true and false. My guess is they want to future proof to support future values. I think they realized this mistake when they made load_balancing.cross_zone.enabled with values true, false, and use_load_balancer_configuration 😄 .

From: https://docs.aws.amazon.com/cli/latest/reference/elbv2/modify-target-group-attributes.html

load_balancing.algorithm.anomaly_mitigation - Only available when load_balancing.algorithm.type is weighted_random . Indicates whether anomaly mitigation is enabled. The value is on or off . The default is off .

github-actions[bot] commented 6 months ago

This functionality has been released in v5.32.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

nitrocode commented 6 months ago

Thanks @bclodius. Great contribution!

github-actions[bot] commented 5 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.