Skip to content

Commit

Permalink
support connection tracking specification and metric stats period (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenbaum authored Feb 16, 2025
1 parent 8e45f47 commit bb29c08
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ Note: the default behavior of the module is to create an autoscaling group and l
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.82.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.85 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.82.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.85 |

## Modules

Expand Down Expand Up @@ -331,7 +331,7 @@ No modules.
| <a name="input_min_size"></a> [min\_size](#input\_min\_size) | The minimum size of the autoscaling group | `number` | `null` | no |
| <a name="input_mixed_instances_policy"></a> [mixed\_instances\_policy](#input\_mixed\_instances\_policy) | Configuration block containing settings to define launch targets for Auto Scaling groups | `any` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | Name used across the resources created | `string` | n/a | yes |
| <a name="input_network_interfaces"></a> [network\_interfaces](#input\_network\_interfaces) | Customize network interfaces to be attached at instance boot time | `list(any)` | `[]` | no |
| <a name="input_network_interfaces"></a> [network\_interfaces](#input\_network\_interfaces) | Customize network interfaces to be attached at instance boot time | `any` | `[]` | no |
| <a name="input_placement"></a> [placement](#input\_placement) | The placement of the instance | `map(string)` | `{}` | no |
| <a name="input_placement_group"></a> [placement\_group](#input\_placement\_group) | The name of the placement group into which you'll launch your instances, if any | `string` | `null` | no |
| <a name="input_private_dns_name_options"></a> [private\_dns\_name\_options](#input\_private\_dns\_name\_options) | The options for the instance hostname. The default values are inherited from the subnet | `map(string)` | `{}` | no |
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.82.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.85 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.82.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.85 |

## Modules

Expand Down
5 changes: 5 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ module "complete" {
description = "eth0"
device_index = 0
security_groups = [module.asg_sg.security_group_id]
connection_tracking_specification = {
tcp_established_timeout = 60
udp_stream_timeout = 60
udp_timeout = 60
}
},
{
delete_on_termination = true
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.82.1"
version = ">= 5.85"
}
}
}
14 changes: 12 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ resource "aws_launch_template" "this" {
# Ref: https://github.com/hashicorp/terraform-provider-aws/issues/4570
security_groups = compact(concat(try(network_interfaces.value.security_groups, []), var.security_groups))
subnet_id = try(network_interfaces.value.subnet_id, null)

dynamic "connection_tracking_specification" {
for_each = try([network_interfaces.value.connection_tracking_specification], [])
content {
tcp_established_timeout = try(connection_tracking_specification.value.tcp_established_timeout, null)
udp_stream_timeout = try(connection_tracking_specification.value.udp_stream_timeout, null)
udp_timeout = try(connection_tracking_specification.value.udp_timeout, null)
}
}
}
}

Expand Down Expand Up @@ -1061,8 +1070,9 @@ resource "aws_autoscaling_policy" "this" {
}
}

stat = metric_stat.value.stat
unit = try(metric_stat.value.unit, null)
period = try(metric_stat.value.period, null)
stat = metric_stat.value.stat
unit = try(metric_stat.value.unit, null)
}
}

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ variable "maintenance_options" {

variable "network_interfaces" {
description = "Customize network interfaces to be attached at instance boot time"
type = list(any)
type = any
default = []
}

Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.82.1"
version = ">= 5.85"
}
}
}

0 comments on commit bb29c08

Please sign in to comment.