1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- resource "aws_vpc" "main" {
- cidr_block = "172.16.0.0/16"
- enable_dns_hostnames = true
- tags = {
- name = "monkeybox_emr_lab"
- project = "monkeybox_emr_lab"
- }
- }
- resource "aws_vpc_endpoint_route_table_association" "example" {
- route_table_id = aws_route_table.r.id
- vpc_endpoint_id = aws_vpc_endpoint.s3.id
- }
- resource "aws_subnet" "main" {
- vpc_id = aws_vpc.main.id
- cidr_block = "172.16.0.0/20"
- # tfsec:ignore:aws-ec2-no-public-ip-subnet We allow public IPs in the lab
- map_public_ip_on_launch = true
- tags = {
- name = "monkeybox_emr_lab"
- project = "monkeybox_emr_lab"
- }
- }
- resource "aws_internet_gateway" "gw" {
- vpc_id = aws_vpc.main.id
- }
- resource "aws_vpc_endpoint" "s3" {
- vpc_id = aws_vpc.main.id
- service_name = "com.amazonaws.us-east-2.s3"
- tags = {
- project = "monkeybox_emr_lab"
- }
- }
- 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
- }
- }
- resource "aws_main_route_table_association" "a" {
- vpc_id = aws_vpc.main.id
- route_table_id = aws_route_table.r.id
- }
|