Skip to content

Commit 6ca397d

Browse files
authored
Dont hate ipv6 (#55)
* Allow instance to launch w/subnet default ipv6 setting Right now, setting this to 0 launches the instance -- and then causes the instance to be rebuilt on the next run if the subnet defaults to assigning ipv6 addresses. Conditionalizing this on -1 w/null allows the current behaviour to be preserved, while not clobbering instances on subnets w/ipv6 by default. * Add `$self` to contributors list * README updates
1 parent 3cbfe88 commit 6ca397d

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Available targets:
175175
| evaluation_periods | The number of periods over which data is compared to the specified threshold. | number | `5` | no |
176176
| instance_enabled | Flag to control the instance creation. Set to false if it is necessary to skip instance creation | bool | `true` | no |
177177
| instance_type | The type of the instance | string | `t2.micro` | no |
178-
| ipv6_address_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet | number | `0` | no |
178+
| ipv6_address_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet (-1 to use subnet default) | number | `0` | no |
179179
| ipv6_addresses | List of IPv6 addresses from the range of the subnet to associate with the primary network interface | list(string) | `<list>` | no |
180180
| metric_name | The name for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html | string | `StatusCheckFailed_Instance` | no |
181181
| metric_namespace | The namespace for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-namespaces.html | string | `AWS/EC2` | no |
@@ -369,8 +369,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
369369

370370
### Contributors
371371

372-
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sergey Vasilyev][s2504s_avatar]][s2504s_homepage]<br/>[Sergey Vasilyev][s2504s_homepage] | [![Valeriy][drama17_avatar]][drama17_homepage]<br/>[Valeriy][drama17_homepage] | [![Ivan Pinatti][ivan-pinatti_avatar]][ivan-pinatti_homepage]<br/>[Ivan Pinatti][ivan-pinatti_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] | [![Konstantin B][comeanother_avatar]][comeanother_homepage]<br/>[Konstantin B][comeanother_homepage] | [![Maarten van der Hoef][maartenvanderhoef_avatar]][maartenvanderhoef_homepage]<br/>[Maarten van der Hoef][maartenvanderhoef_homepage] |
373-
|---|---|---|---|---|---|---|---|---|
372+
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sergey Vasilyev][s2504s_avatar]][s2504s_homepage]<br/>[Sergey Vasilyev][s2504s_homepage] | [![Valeriy][drama17_avatar]][drama17_homepage]<br/>[Valeriy][drama17_homepage] | [![Ivan Pinatti][ivan-pinatti_avatar]][ivan-pinatti_homepage]<br/>[Ivan Pinatti][ivan-pinatti_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] | [![Konstantin B][comeanother_avatar]][comeanother_homepage]<br/>[Konstantin B][comeanother_homepage] | [![Maarten van der Hoef][maartenvanderhoef_avatar]][maartenvanderhoef_homepage]<br/>[Maarten van der Hoef][maartenvanderhoef_homepage] | [![Chris Weyl][rsrchboy_avatar]][rsrchboy_homepage]<br/>[Chris Weyl][rsrchboy_homepage] |
373+
|---|---|---|---|---|---|---|---|---|---|
374374

375375
[osterman_homepage]: https://github.com/osterman
376376
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
@@ -390,6 +390,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
390390
[comeanother_avatar]: https://img.cloudposse.com/150x150/https://github.com/comeanother.png
391391
[maartenvanderhoef_homepage]: https://github.com/maartenvanderhoef
392392
[maartenvanderhoef_avatar]: https://img.cloudposse.com/150x150/https://github.com/maartenvanderhoef.png
393+
[rsrchboy_homepage]: https://github.com/rsrchboy
394+
[rsrchboy_avatar]: https://img.cloudposse.com/150x150/https://github.com/rsrchboy.png
393395

394396
[![README Footer][readme_footer_img]][readme_footer_link]
395397
[![Beacon][beacon]][website]

README.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@ contributors:
138138
github: "comeanother"
139139
- name: "Maarten van der Hoef"
140140
github: "maartenvanderhoef"
141+
- name: "Chris Weyl"
142+
github: "rsrchboy"

docs/terraform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
| evaluation_periods | The number of periods over which data is compared to the specified threshold. | number | `5` | no |
2828
| instance_enabled | Flag to control the instance creation. Set to false if it is necessary to skip instance creation | bool | `true` | no |
2929
| instance_type | The type of the instance | string | `t2.micro` | no |
30-
| ipv6_address_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet | number | `0` | no |
30+
| ipv6_address_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet (-1 to use subnet default) | number | `0` | no |
3131
| ipv6_addresses | List of IPv6 addresses from the range of the subnet to associate with the primary network interface | list(string) | `<list>` | no |
3232
| metric_name | The name for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html | string | `StatusCheckFailed_Instance` | no |
3333
| metric_namespace | The namespace for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-namespaces.html | string | `AWS/EC2` | no |

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ resource "aws_instance" "default" {
104104
monitoring = var.monitoring
105105
private_ip = var.private_ip
106106
source_dest_check = var.source_dest_check
107-
ipv6_address_count = var.ipv6_address_count
108-
ipv6_addresses = var.ipv6_addresses
107+
ipv6_address_count = var.ipv6_address_count < 0 ? null : var.ipv6_address_count
108+
ipv6_addresses = length(var.ipv6_addresses) == 0 ? null : var.ipv6_addresses
109109

110110
vpc_security_group_ids = compact(
111111
concat(

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ variable "source_dest_check" {
146146

147147
variable "ipv6_address_count" {
148148
type = number
149-
description = "Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet"
149+
description = "Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet (-1 to use subnet default)"
150150
default = 0
151151
}
152152

0 commit comments

Comments
 (0)