-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathplan.tf
87 lines (74 loc) · 1.89 KB
/
plan.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
terraform {
backend "s3" {
bucket = "sensu-omnibus-artifacts"
key = "terraform/sensu-omnibus"
region = "us-east-1"
}
}
variable "region" {
default = "us-west-2"
}
provider "aws" {
region = "${var.region}"
}
locals {
common_tags = "${map(
"Name", "Sensu Classic Build Automation"
)}"
}
resource "aws_security_group" "test_kitchen" {
description = "test-kitchen instances"
vpc_id = "${aws_vpc.main.id}"
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
ingress {
from_port = 22
to_port = 22
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
description = "SSH Access"
}
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
tags = "${merge(local.common_tags,
map("Name", "Sensu Classic Build Automation (DO NOT DELETE)"))}"
}
resource "aws_subnet" "main" {
vpc_id = "${aws_vpc.main.id}"
cidr_block = "10.0.1.0/24"
tags = "${merge(local.common_tags, map())}"
}
resource "aws_internet_gateway" "gw" {
vpc_id = "${aws_vpc.main.id}"
tags = "${merge(local.common_tags, map())}"
}
resource "aws_route_table" "r" {
vpc_id = "${aws_vpc.main.id}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gw.id}"
}
tags = "${merge(local.common_tags, map())}"
}
resource "aws_main_route_table_association" "a" {
vpc_id = "${aws_vpc.main.id}"
route_table_id = "${aws_route_table.r.id}"
}
output "vpc_id" {
value = "${aws_vpc.main.id}"
}
output "security_group_id" {
value = "${aws_security_group.test_kitchen.id}"
}
output "subnet_id" {
value = "${aws_subnet.main.id}"
}