-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvpc.tf
57 lines (47 loc) · 1.22 KB
/
vpc.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Terraform Training VPC
resource "aws_vpc" "vpc" {
cidr_block = var.vpc_cidr
instance_tenancy = "default"
enable_dns_hostnames = "true"
enable_classiclink = "false"
tags = {
Name = var.vpc_name
}
}
# Terraform Training Subnets
resource "aws_subnet" "public-1" {
vpc_id = aws_vpc.vpc.id
cidr_block = var.subnet_cidr["fe1"]
map_public_ip_on_launch = "true"
availability_zone = "eu-west-1a"
tags = {
Name = "public-1"
}
}
resource "aws_subnet" "public-2" {
vpc_id = aws_vpc.vpc.id
cidr_block = var.subnet_cidr["fe2"]
map_public_ip_on_launch = "true"
availability_zone = "eu-west-1b"
tags = {
Name = "public-2"
}
}
resource "aws_subnet" "private-1" {
vpc_id = aws_vpc.vpc.id
cidr_block = var.subnet_cidr["be1"]
map_public_ip_on_launch = "false"
availability_zone = "eu-west-1a"
tags = {
Name = "private-1"
}
}
resource "aws_subnet" "private-2" {
vpc_id = aws_vpc.vpc.id
cidr_block = var.subnet_cidr["be2"]
map_public_ip_on_launch = "false"
availability_zone = "eu-west-1b"
tags = {
Name = "private-2"
}
}