forked from bregman-arie/devops-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
49 lines (42 loc) · 905 Bytes
/
main.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
# Variables
variable "vpc_id" {
type = string
}
# AWS Subnets
resource "aws_subnet" "NewSubnet1" {
cidr_block = "10.0.0.0/24"
vpc_id = var.vpc_id
availability_zone = data.aws_availability_zones.all.names[0]
tags = {
Purpose: exercise
Name: "NewSubnet1"
}
}
resource "aws_subnet" "NewSubnet2" {
cidr_block = "10.0.1.0/24"
vpc_id = var.vpc_id
availability_zone = data.aws_availability_zones.all.names[1]
tags = {
Purpose: exercise
Name: "NewSubnet2"
}
}
resource "aws_subnet" "NewSubnet3" {
cidr_block = "10.0.2.0/24"
vpc_id = var.vpc_id
availability_zone = data.aws_availability_zones.all.names[2]
tags = {
Purpose: exercise
Name: "NewSubnet3"
}
}
# Outputs
output "NewSubnet1-id" {
value = aws_subnet.NewSubnet1.id
}
output "NewSubnet2-id" {
value = aws_subnet.NewSubnet2.id
}
output "NewSubnet3-id" {
value = aws_subnet.NewSubnet3.id
}