-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
66 lines (56 loc) · 1.43 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
provider "aws" {
region = "ap-northeast-1"
}
resource "aws_vpc" "demo" {
assign_generated_ipv6_cidr_block = false
cidr_block = "10.0.0.0/16"
enable_classiclink = false
enable_classiclink_dns_support = false
enable_dns_hostnames = true
enable_dns_support = true
instance_tenancy = "default"
}
resource "aws_internet_gateway" "demo" {
vpc_id = aws_vpc.demo.id
}
resource "aws_route_table" "public_route" {
vpc_id = aws_vpc.demo.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.demo.id
}
}
resource "aws_subnet" "public_subnet_1a" {
vpc_id = aws_vpc.demo.id
availability_zone = "ap-northeast-1a"
cidr_block = "10.0.100.0/24"
map_public_ip_on_launch = true
}
resource "aws_route_table_association" "puclic_route_table_association_1a" {
subnet_id = aws_subnet.public_subnet_1a.id
route_table_id = aws_route_table.public_route.id
}
resource "aws_security_group" "redshift_sg" {
name = "redshift-sg"
vpc_id = aws_vpc.demo.id
ingress {
from_port = 5439
to_port = 5439
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}