Skip to content

Commit

Permalink
vpc endpoint private dns
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrell Bolger committed Apr 10, 2024
1 parent 9771630 commit 7d39fb2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
19 changes: 10 additions & 9 deletions modules/vpc-endpoint/src/main.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
resource "aws_vpc_endpoint" "main" {
vpc_id = var.vpc_id
service_name = var.service_name
auto_accept = var.auto_accept
policy = var.policy
vpc_endpoint_type = var.vpc_endpoint_type
route_table_ids = var.route_table_ids

security_group_ids = var.security_group_ids
vpc_id = var.vpc_id
service_name = var.service_name
auto_accept = var.auto_accept
policy = var.policy
vpc_endpoint_type = var.vpc_endpoint_type
route_table_ids = var.route_table_ids
private_dns_enabled = var.private_dns_enabled
subnet_ids = var.subnet_ids
security_group_ids = var.security_group_ids

tags = merge(
{
Name = "${var.zone}-${var.environment}-${lookup(local.short_regions, var.region)}-${local.identifier}-vep"
Name = "${var.zone}-${var.environment}-${local.identifier}-${lookup(local.short_regions, var.region)}-vep"
},
var.tags
)
Expand Down
13 changes: 12 additions & 1 deletion modules/vpc-endpoint/src/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ variable "policy" {
default = null
}

variable "private_dns_enabled" {
type = bool
default = false
}

variable "private_ip" {
type = string
default = null
Expand All @@ -26,7 +31,8 @@ variable "region" {
}

variable "route_table_ids" {
type = list(string)
type = list(string)
default = []
}

variable "security_group_ids" {
Expand All @@ -38,6 +44,11 @@ variable "service_name" {
type = string
}

variable "subnet_ids" {
type = list(string)
default = []
}

variable "tags" {
type = map(string)
default = {}
Expand Down
5 changes: 2 additions & 3 deletions modules/vpc-endpoint/test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ module "vpc_endpoint" {
region = "eu-west-2"
zone = "bat"

route_table_ids = ["foo"]
service_name = "foobar"
vpc_id = "id"
service_name = "foo"
vpc_id = "id"

tags = {
Foo = "Bar"
Expand Down

0 comments on commit 7d39fb2

Please sign in to comment.