Skip to content

Commit ff20fa2

Browse files
committed
feat(vpc): sqs interface endpoint
1 parent cb2a964 commit ff20fa2

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

vpc.tf

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ resource "aws_route_table_association" "private_rt_association" {
7979
}
8080

8181
resource "aws_vpc_endpoint" "dynamodb" {
82-
service_name = "com.amazonaws.${var.aws_region}.dynamodb"
83-
vpc_id = aws_vpc.main.id
82+
service_name = "com.amazonaws.${var.aws_region}.dynamodb"
83+
vpc_id = aws_vpc.main.id
84+
vpc_endpoint_type = "Gateway"
8485

8586
route_table_ids = [aws_route_table.public_rt.id]
8687

@@ -89,6 +90,22 @@ resource "aws_vpc_endpoint" "dynamodb" {
8990
}
9091
}
9192

93+
94+
resource "aws_vpc_endpoint" "sqs" {
95+
service_name = "com.amazonaws.${var.aws_region}.sqs"
96+
vpc_id = aws_vpc.main.id
97+
vpc_endpoint_type = "Interface"
98+
99+
subnet_ids = aws_subnet.public_subnets[*].id
100+
security_group_ids = [aws_default_security_group.default.id]
101+
102+
private_dns_enabled = true
103+
104+
tags = {
105+
Name = "SOAT-TC SQS VPC Interface Endpoint"
106+
}
107+
}
108+
92109
resource "aws_default_security_group" "default" {
93110
vpc_id = aws_vpc.main.id
94111

vpc_outputs.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,26 @@ output "vpc_private_rt" {
5656
"vpc_id" : aws_route_table.private_rt.vpc_id
5757
}
5858
}
59+
60+
output "vpc_endpoint_dynamodb" {
61+
description = "Endpoint for DynamoDB"
62+
value = {
63+
"arn" : aws_vpc_endpoint.dynamodb.arn,
64+
"id" : aws_vpc_endpoint.dynamodb.id,
65+
"service_name" : aws_vpc_endpoint.dynamodb.service_name,
66+
"vpc_endpoint_type" : aws_vpc_endpoint.dynamodb.vpc_endpoint_type,
67+
"vpc_id" : aws_vpc_endpoint.dynamodb.vpc_id,
68+
}
69+
}
70+
71+
output "vpc_endpoint_sqs" {
72+
description = "Endpoint for SQS"
73+
value = {
74+
"arn" : aws_vpc_endpoint.sqs.arn,
75+
"dns_entry" : aws_vpc_endpoint.sqs.dns_entry,
76+
"id" : aws_vpc_endpoint.sqs.id,
77+
"service_name" : aws_vpc_endpoint.sqs.service_name,
78+
"vpc_endpoint_type" : aws_vpc_endpoint.sqs.vpc_endpoint_type,
79+
"vpc_id" : aws_vpc_endpoint.sqs.vpc_id,
80+
}
81+
}

0 commit comments

Comments
 (0)