Skip to content

Commit

Permalink
Update i2_vpc_cloud_project.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
ACE-336 authored May 10, 2024
1 parent d9f21b5 commit d0e0ba7
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion i2_vpc_cloud_project.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resource "aws_vpn_gateway" "i2_project_terraform_virtual_private_gateway" {
}
}

// Attach Virtual Private Gateway to VPC
// Attach Virtual Private Gateway
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpn_gateway_attachment
resource "aws_vpn_gateway_attachment" "vpn_attachment" {
vpc_id = aws_vpc.i2_project_aws_terraform_vpc.id
Expand All @@ -72,6 +72,36 @@ resource "aws_dx_gateway_association_proposal" "i2_project_terraform_dx_gateway_
allowed_prefixes = ["10.3.1.0/24"]
}

// Create Internet Gateway
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/internet_gateway
resource "aws_internet_gateway" "i2_project_aws_terraform_igw" {
vpc_id = aws_vpc.i2_project_aws_terraform_vpc.id
tags = {
Name = "i2_project_terraform_igw"
}
}

// Create a route table
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table.html
resource "aws_route_table" "i2_project_aws_terraform_route_table" {
vpc_id = aws_vpc.i2_project_aws_terraform_vpc.id
}

// Create a route to the Internet Gateway
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route
resource "aws_route" "i2_project_aws_terraform_internet_gateway_route" {
route_table_id = aws_route_table.i2_project_aws_terraform_route_table.id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.i2_project_aws_terraform_igw.id
}

// Associate the route table with the subnet
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association
resource "aws_route_table_association" "i2_project_aws_terraform_route_table_association" {
subnet_id = aws_subnet.i2_project_aws_terraform_subnet_1.id
route_table_id = aws_route_table.i2_project_aws_terraform_route_table.id
}

// ***AWS Security Group***
// https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group
resource "aws_security_group" "allow_ssh_icmp_from_gcp" {
Expand Down

0 comments on commit d0e0ba7

Please sign in to comment.