1
0
mirror of https://github.com/Loofort/terraform-aws-gitea synced 2024-11-22 02:32:02 +01:00
terraform-aws-gitea/vpc/vpc.tf
2018-12-16 15:12:43 +03:00

37 lines
907 B
HCL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# VPC
resource "aws_vpc" "this" {
tags = "${var.tags}"
cidr_block = "${var.cidr}"
enable_dns_support = true
enable_dns_hostnames = true
}
# Internet Gateway
resource "aws_internet_gateway" "gw" {
vpc_id = "${aws_vpc.this.id}"
tags = "${var.tags}"
}
# Publiс router
resource "aws_route_table" "public" {
vpc_id = "${aws_vpc.this.id}"
tags = "${var.tags}"
route {
cidr_block = "0.0.0.0/0"
gateway_id = "${aws_internet_gateway.gw.id}"
}
}
# Subnet
resource "aws_subnet" "public" {
vpc_id = "${aws_vpc.this.id}"
tags = "${var.tags}"
cidr_block = "${var.cidr_subnet}"
availability_zone = "${local.az}"
map_public_ip_on_launch = true
}
resource "aws_route_table_association" "public" {
subnet_id = "${aws_subnet.public.id}"
route_table_id = "${aws_route_table.public.id}"
}