Skip to content

Commit 736931b

Browse files
authored
fix: Remove EC2-classic deprecation warnings by hardcoding classiclink values to null (#826)
1 parent 4e57428 commit 736931b

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ No modules.
346346
| <a name="input_default_security_group_ingress"></a> [default\_security\_group\_ingress](#input\_default\_security\_group\_ingress) | List of maps of ingress rules to set on the default security group | `list(map(string))` | `[]` | no |
347347
| <a name="input_default_security_group_name"></a> [default\_security\_group\_name](#input\_default\_security\_group\_name) | Name to be used on the default security group | `string` | `null` | no |
348348
| <a name="input_default_security_group_tags"></a> [default\_security\_group\_tags](#input\_default\_security\_group\_tags) | Additional tags for the default security group | `map(string)` | `{}` | no |
349-
| <a name="input_default_vpc_enable_classiclink"></a> [default\_vpc\_enable\_classiclink](#input\_default\_vpc\_enable\_classiclink) | Should be true to enable ClassicLink in the Default VPC | `bool` | `false` | no |
349+
| <a name="input_default_vpc_enable_classiclink"></a> [default\_vpc\_enable\_classiclink](#input\_default\_vpc\_enable\_classiclink) | [DEPRECATED](https://github.com/hashicorp/terraform/issues/31730) Should be true to enable ClassicLink in the Default VPC | `bool` | `false` | no |
350350
| <a name="input_default_vpc_enable_dns_hostnames"></a> [default\_vpc\_enable\_dns\_hostnames](#input\_default\_vpc\_enable\_dns\_hostnames) | Should be true to enable DNS hostnames in the Default VPC | `bool` | `false` | no |
351351
| <a name="input_default_vpc_enable_dns_support"></a> [default\_vpc\_enable\_dns\_support](#input\_default\_vpc\_enable\_dns\_support) | Should be true to enable DNS support in the Default VPC | `bool` | `true` | no |
352352
| <a name="input_default_vpc_name"></a> [default\_vpc\_name](#input\_default\_vpc\_name) | Name to be used on the Default VPC | `string` | `null` | no |
@@ -369,8 +369,8 @@ No modules.
369369
| <a name="input_elasticache_subnet_suffix"></a> [elasticache\_subnet\_suffix](#input\_elasticache\_subnet\_suffix) | Suffix to append to elasticache subnets name | `string` | `"elasticache"` | no |
370370
| <a name="input_elasticache_subnet_tags"></a> [elasticache\_subnet\_tags](#input\_elasticache\_subnet\_tags) | Additional tags for the elasticache subnets | `map(string)` | `{}` | no |
371371
| <a name="input_elasticache_subnets"></a> [elasticache\_subnets](#input\_elasticache\_subnets) | A list of elasticache subnets | `list(string)` | `[]` | no |
372-
| <a name="input_enable_classiclink"></a> [enable\_classiclink](#input\_enable\_classiclink) | Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. | `bool` | `null` | no |
373-
| <a name="input_enable_classiclink_dns_support"></a> [enable\_classiclink\_dns\_support](#input\_enable\_classiclink\_dns\_support) | Should be true to enable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic. | `bool` | `null` | no |
372+
| <a name="input_enable_classiclink"></a> [enable\_classiclink](#input\_enable\_classiclink) | [DEPRECATED](https://github.com/hashicorp/terraform/issues/31730) Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. | `bool` | `null` | no |
373+
| <a name="input_enable_classiclink_dns_support"></a> [enable\_classiclink\_dns\_support](#input\_enable\_classiclink\_dns\_support) | [DEPRECATED](https://github.com/hashicorp/terraform/issues/31730) Should be true to enable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic. | `bool` | `null` | no |
374374
| <a name="input_enable_dhcp_options"></a> [enable\_dhcp\_options](#input\_enable\_dhcp\_options) | Should be true if you want to specify a DHCP options set with a custom domain name, DNS servers, NTP servers, netbios servers, and/or netbios server type | `bool` | `false` | no |
375375
| <a name="input_enable_dns_hostnames"></a> [enable\_dns\_hostnames](#input\_enable\_dns\_hostnames) | Should be true to enable DNS hostnames in the VPC | `bool` | `false` | no |
376376
| <a name="input_enable_dns_support"></a> [enable\_dns\_support](#input\_enable\_dns\_support) | Should be true to enable DNS support in the VPC | `bool` | `true` | no |

examples/complete-vpc/main.tf

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ module "vpc" {
2020
source = "../../"
2121

2222
name = local.name
23-
cidr = "20.10.0.0/16" # 10.0.0.0/8 is reserved for EC2-Classic
23+
cidr = "10.0.0.0/16"
2424

2525
azs = ["${local.region}a", "${local.region}b", "${local.region}c"]
26-
private_subnets = ["20.10.1.0/24", "20.10.2.0/24", "20.10.3.0/24"]
27-
public_subnets = ["20.10.11.0/24", "20.10.12.0/24", "20.10.13.0/24"]
28-
database_subnets = ["20.10.21.0/24", "20.10.22.0/24", "20.10.23.0/24"]
29-
elasticache_subnets = ["20.10.31.0/24", "20.10.32.0/24", "20.10.33.0/24"]
30-
redshift_subnets = ["20.10.41.0/24", "20.10.42.0/24", "20.10.43.0/24"]
31-
intra_subnets = ["20.10.51.0/24", "20.10.52.0/24", "20.10.53.0/24"]
26+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
27+
public_subnets = ["10.0.11.0/24", "10.0.12.0/24", "10.0.13.0/24"]
28+
database_subnets = ["10.0.21.0/24", "10.0.22.0/24", "10.0.23.0/24"]
29+
elasticache_subnets = ["10.0.31.0/24", "10.0.32.0/24", "10.0.33.0/24"]
30+
redshift_subnets = ["10.0.41.0/24", "10.0.42.0/24", "10.0.43.0/24"]
31+
intra_subnets = ["10.0.51.0/24", "10.0.52.0/24", "10.0.53.0/24"]
3232

3333
create_database_subnet_group = false
3434

@@ -44,9 +44,6 @@ module "vpc" {
4444
enable_dns_hostnames = true
4545
enable_dns_support = true
4646

47-
enable_classiclink = true
48-
enable_classiclink_dns_support = true
49-
5047
enable_nat_gateway = true
5148
single_nat_gateway = true
5249

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ resource "aws_vpc" "this" {
2424
instance_tenancy = var.instance_tenancy
2525
enable_dns_hostnames = var.enable_dns_hostnames
2626
enable_dns_support = var.enable_dns_support
27-
enable_classiclink = var.enable_classiclink
28-
enable_classiclink_dns_support = var.enable_classiclink_dns_support
27+
enable_classiclink = null # https://github.com/hashicorp/terraform/issues/31730
28+
enable_classiclink_dns_support = null # https://github.com/hashicorp/terraform/issues/31730
2929
assign_generated_ipv6_cidr_block = var.enable_ipv6
3030

3131
tags = merge(
@@ -1234,7 +1234,7 @@ resource "aws_default_vpc" "this" {
12341234

12351235
enable_dns_support = var.default_vpc_enable_dns_support
12361236
enable_dns_hostnames = var.default_vpc_enable_dns_hostnames
1237-
enable_classiclink = var.default_vpc_enable_classiclink
1237+
enable_classiclink = null # https://github.com/hashicorp/terraform/issues/31730
12381238

12391239
tags = merge(
12401240
{ "Name" = coalesce(var.default_vpc_name, "default") },

variables.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,16 @@ variable "enable_dns_support" {
280280
default = true
281281
}
282282

283+
# tflint-ignore: terraform_unused_declarations
283284
variable "enable_classiclink" {
284-
description = "Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic."
285+
description = "[DEPRECATED](https://github.com/hashicorp/terraform/issues/31730) Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic."
285286
type = bool
286287
default = null
287288
}
288289

290+
# tflint-ignore: terraform_unused_declarations
289291
variable "enable_classiclink_dns_support" {
290-
description = "Should be true to enable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic."
292+
description = "[DEPRECATED](https://github.com/hashicorp/terraform/issues/31730) Should be true to enable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic."
291293
type = bool
292294
default = null
293295
}
@@ -694,8 +696,9 @@ variable "default_vpc_enable_dns_hostnames" {
694696
default = false
695697
}
696698

699+
# tflint-ignore: terraform_unused_declarations
697700
variable "default_vpc_enable_classiclink" {
698-
description = "Should be true to enable ClassicLink in the Default VPC"
701+
description = "[DEPRECATED](https://github.com/hashicorp/terraform/issues/31730) Should be true to enable ClassicLink in the Default VPC"
699702
type = bool
700703
default = false
701704
}

0 commit comments

Comments
 (0)