File tree Expand file tree Collapse file tree 4 files changed +36
-1
lines changed
Expand file tree Collapse file tree 4 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -507,3 +507,23 @@ resource "aws_vpn_connection" "main" {
507507
508508 tags = var. default_tags
509509}
510+
511+
512+ # # VPC Endpoint
513+
514+ resource "aws_vpc_endpoint" "main" {
515+ count = var. create ? length (var. vpc_endpoint ) : 0
516+
517+ epends_on = [ aws_vpc . main ]
518+
519+ vpc_id = aws_vpc. main . 0 . id
520+ service_name = lookup (var. vpc_endpoint [count . index ], " service_name" , null )
521+ vpc_endpoint_type = lookup (var. vpc_endpoint [count . index ], " endpoint_type" , null )
522+ private_dns_enabled = lookup (var. vpc_endpoint [count . index ], " private_dns_enabled" , " false" )
523+
524+ route_table_ids = [ aws_route_table . private . * . id , aws_route_table . public . * . id ]
525+
526+ tags = merge ({
527+ Name = " ${ var . vpc_name } -VPC_EP"
528+ }, var. default_tags )
529+ }
Original file line number Diff line number Diff line change 1- output "id " {
1+ output "vpc_id " {
22 value = data. aws_vpc . selected . id
33}
4+ output "vpc_cidr" {
5+ value = data. aws_vpc . selected . cidr_block
6+ }
47output "subnet_private" {
58 value = length (aws_subnet. private ) > 1 ? aws_subnet. private . * . cidr_block : null
69}
@@ -25,6 +28,15 @@ output "elastic_ip" {
2528output "elastic_ip_database" {
2629 value = length (aws_eip. database ) > 1 ? aws_eip. database . 0 . public_ip : null
2730}
31+ output "nat_gateway_public_ip" {
32+ value = length (aws_nat_gateway. public ) > 1 ? aws_nat_gateway. public . * . public_ip : null
33+ }
34+ output "nat_gateway_private_ip" {
35+ value = length (aws_nat_gateway. public ) > 1 ? aws_nat_gateway. public . * . private_ip : null
36+ }
37+ output "nat_gateway_id" {
38+ value = length (aws_nat_gateway. public ) > 1 ? aws_nat_gateway. public . * . id : null
39+ }
2840output "subnet_db" {
2941 value = length (aws_db_subnet_group. database ) > 1 ? aws_db_subnet_group. database . * . id : null
3042}
@@ -36,4 +48,7 @@ output "rt_private_id" {
3648}
3749output "rt_public_id" {
3850 value = length (aws_route_table. public ) > 1 ? aws_route_table. public . * . id : null
51+ }
52+ output "vpc_endpoint_id" {
53+ value = length (aws_vpc_endpoint. main ) > 1 ? aws_vpc_endpoint. main . * . id : null
3954}
You can’t perform that action at this time.
0 commit comments