forked from newcontext-oss/opencti-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes newcontext-oss#9 - Adding internet gateway to fix SSM issues.
- Loading branch information
Dustin Butterworth
authored and
Dustin Butterworth
committed
Apr 2, 2024
1 parent
48b841d
commit c3a4262
Showing
5 changed files
with
55 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,54 @@ | ||
# This code creates a VPC and Subnet. The code applies just fine. But Systems Manager (SSM) is unusable. Says something isn't right. Been tracking it down for far too long and it's outside the scope of this change anyway so commenting and moving along. This VPC/Subnet issue is tracked in #9. | ||
# resource "aws_vpc" "opencti_vpc" { | ||
# cidr_block = "10.1.0.0/16" | ||
|
||
# tags = { | ||
# Name = "OpenCTI VPC" | ||
# } | ||
# } | ||
|
||
# resource "aws_subnet" "opencti_subnet" { | ||
# vpc_id = aws_vpc.opencti_vpc.id | ||
# cidr_block = "10.1.10.0/24" | ||
# availability_zone = var.availability_zone | ||
|
||
# tags = { | ||
# Name = "OpenCTI subnet" | ||
# } | ||
# } | ||
|
||
# resource "aws_network_interface" "opencti_nic" { | ||
# subnet_id = aws_subnet.opencti_subnet.id | ||
# # private_ips = ["10.1.10.100"] | ||
# security_groups = [ aws_security_group.opencti_sg.id ] | ||
|
||
# tags = { | ||
# Name = "primary_network_interface" | ||
# } | ||
# } | ||
resource "aws_vpc" "opencti_vpc" { | ||
cidr_block = "10.1.0.0/16" | ||
|
||
tags = { | ||
Name = "OpenCTI VPC" | ||
} | ||
} | ||
|
||
resource "aws_subnet" "opencti_subnet" { | ||
vpc_id = aws_vpc.opencti_vpc.id | ||
cidr_block = "10.1.10.0/24" | ||
availability_zone = var.availability_zone | ||
|
||
tags = { | ||
Name = "OpenCTI subnet" | ||
} | ||
} | ||
|
||
resource "aws_internet_gateway" "opencti_gw" { | ||
vpc_id = aws_vpc.opencti_vpc.id | ||
|
||
tags = { | ||
Name = "opencti_internet_gateway" | ||
} | ||
} | ||
|
||
resource "aws_route_table" "opencti_rt" { | ||
vpc_id = aws_vpc.opencti_vpc.id | ||
|
||
route { | ||
cidr_block = "0.0.0.0/0" | ||
gateway_id = aws_internet_gateway.opencti_gw.id | ||
} | ||
|
||
tags = { | ||
Name = "opencti_route_table" | ||
} | ||
} | ||
|
||
resource "aws_route_table_association" "opencti_route_assoc" { | ||
subnet_id = aws_subnet.opencti_subnet.id | ||
route_table_id = aws_route_table.opencti_rt.id | ||
} | ||
|
||
resource "aws_network_interface" "opencti_nic" { | ||
subnet_id = aws_subnet.opencti_subnet.id | ||
# private_ips = ["10.1.10.100"] | ||
security_groups = [aws_security_group.opencti_sg.id] | ||
|
||
tags = { | ||
Name = "primary_network_interface" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ login_email = "[email protected]" | |
# region = "us-east-1" | ||
# root_volume_size = 32 | ||
# storage_bucket = "opencti-storage" | ||
subnet_id = "" | ||
vpc_id = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters