Skip to content

Commit

Permalink
Merge pull request #149 from ExpediaGroup/feature/enable_vpce
Browse files Browse the repository at this point in the history
feat: add waggledance vpce
  • Loading branch information
githubjianli authored Dec 10, 2024
2 parents 1f9c307 + 6254555 commit 32079e1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.5.6] - 2024-12-10
### Added
- Added waggledance VPC endpoint service
- Added following new variables to support waggledance VPC endpint service:
- `enable_vpc_endpoint_services`
- `waggledance_customer_accounts`

## [4.5.5] - 2024-10-04
### Added
- Added variables to control Waggledance deployment dns policy and config.
Expand Down
14 changes: 14 additions & 0 deletions endpoints.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,17 @@ resource "aws_route53_record" "metastore_alias" {
ttl = "60"
records = [aws_vpc_endpoint.remote_metastores[count.index].dns_entry[0].dns_name]
}


data "aws_lb" "waggledance_lb" {
count = var.wd_instance_type == "k8s" && var.enable_vpc_endpoint_services ? 1 : 0
name = split("-", split(".", kubernetes_service.waggle_dance[0].status.0.load_balancer.0.ingress.0.hostname).0).0
}

resource "aws_vpc_endpoint_service" "waggledance" {
count = var.enable_vpc_endpoint_services ? 1 : 0
network_load_balancer_arns = var.wd_instance_type == "ecs" ? aws_lb.waggledance[0].*.arn : data.aws_lb.waggledance_lb[0].*.arn
acceptance_required = false
allowed_principals = formatlist("arn:aws:iam::%s:root", var.waggledance_customer_accounts)
tags = merge(tomap({"Name"="${local.instance_alias}"}), var.tags)
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -524,3 +524,15 @@ variable "extended_server_config" {
type = string
default = ""
}

variable "enable_vpc_endpoint_services" {
description = "Enable metastore NLB, Route53 entries VPC access and VPC endpoint services, for cross-account access."
type = bool
default = false
}

variable "waggledance_customer_accounts" {
description = "Waggledance VPC Endpoint customer accounts"
type = list(string)
default = []
}

0 comments on commit 32079e1

Please sign in to comment.