Skip to content

Commit 32d1aa1

Browse files
authored
Added support for EC2 ClassicLink (#322)
1 parent c0f5674 commit 32d1aa1

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
294294
| elasticloadbalancing\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for Elastic Load Balancing endpoint | list(string) | `[]` | no |
295295
| elasticloadbalancing\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for Elastic Load Balancing endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | list(string) | `[]` | no |
296296
| enable\_apigw\_endpoint | Should be true if you want to provision an api gateway endpoint to the VPC | bool | `"false"` | no |
297+
| enable\_classiclink | Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. | bool | `"null"` | no |
298+
| 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 |
297299
| enable\_cloudtrail\_endpoint | Should be true if you want to provision a CloudTrail endpoint to the VPC | bool | `"false"` | no |
298300
| enable\_codebuild\_endpoint | Should be true if you want to provision an Codebuild endpoint to the VPC | string | `"false"` | no |
299301
| enable\_codecommit\_endpoint | Should be true if you want to provision an Codecommit endpoint to the VPC | string | `"false"` | no |

examples/complete-vpc/main.tf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@ module "vpc" {
1212

1313
name = "complete-example"
1414

15-
cidr = "10.10.0.0/16"
15+
cidr = "20.10.0.0/16" # 10.0.0.0/8 is reserved for EC2-Classic
1616

1717
azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
18-
private_subnets = ["10.10.1.0/24", "10.10.2.0/24", "10.10.3.0/24"]
19-
public_subnets = ["10.10.11.0/24", "10.10.12.0/24", "10.10.13.0/24"]
20-
database_subnets = ["10.10.21.0/24", "10.10.22.0/24", "10.10.23.0/24"]
21-
elasticache_subnets = ["10.10.31.0/24", "10.10.32.0/24", "10.10.33.0/24"]
22-
redshift_subnets = ["10.10.41.0/24", "10.10.42.0/24", "10.10.43.0/24"]
23-
intra_subnets = ["10.10.51.0/24", "10.10.52.0/24", "10.10.53.0/24"]
18+
private_subnets = ["20.10.1.0/24", "20.10.2.0/24", "20.10.3.0/24"]
19+
public_subnets = ["20.10.11.0/24", "20.10.12.0/24", "20.10.13.0/24"]
20+
database_subnets = ["20.10.21.0/24", "20.10.22.0/24", "20.10.23.0/24"]
21+
elasticache_subnets = ["20.10.31.0/24", "20.10.32.0/24", "20.10.33.0/24"]
22+
redshift_subnets = ["20.10.41.0/24", "20.10.42.0/24", "20.10.43.0/24"]
23+
intra_subnets = ["20.10.51.0/24", "20.10.52.0/24", "20.10.53.0/24"]
2424

2525
create_database_subnet_group = false
2626

2727
enable_dns_hostnames = true
2828
enable_dns_support = true
2929

30+
enable_classiclink = true
31+
enable_classiclink_dns_support = true
32+
3033
enable_nat_gateway = true
3134
single_nat_gateway = true
3235

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ resource "aws_vpc" "this" {
3333
instance_tenancy = var.instance_tenancy
3434
enable_dns_hostnames = var.enable_dns_hostnames
3535
enable_dns_support = var.enable_dns_support
36+
enable_classiclink = var.enable_classiclink
37+
enable_classiclink_dns_support = var.enable_classiclink_dns_support
3638
assign_generated_ipv6_cidr_block = var.enable_ipv6
3739

3840
tags = merge(

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ variable "enable_dns_support" {
256256
default = true
257257
}
258258

259+
variable "enable_classiclink" {
260+
description = "Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic."
261+
type = bool
262+
default = null
263+
}
264+
265+
variable "enable_classiclink_dns_support" {
266+
description = "Should be true to enable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic."
267+
type = bool
268+
default = null
269+
}
270+
259271
variable "enable_nat_gateway" {
260272
description = "Should be true if you want to provision NAT Gateways for each of your private networks"
261273
type = bool

0 commit comments

Comments
 (0)