Skip to content

Commit

Permalink
fix: add new variable external_database_host_readonly (#275)
Browse files Browse the repository at this point in the history
Co-authored-by: janli <[email protected]>
  • Loading branch information
githubjianli and JianLi-Expedia authored Sep 10, 2024
1 parent 0de5c37 commit 2460749
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ 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).

## [7.3.6] - 2024-09-10
### Added
- Added new variable `external_database_host_readonly` to handle externel mysql readonly host.
### Removed
- Removed s3 log bucket `INTELLIGENT_TIERING` transistion to reduce extra cost on access log transfer storage class type as log bucket has expiration configured.

## [7.3.5] - 2024-09-02
### Added
- Use unique SID in IAM Policy.
Expand Down
2 changes: 2 additions & 0 deletions VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
| encrypt\_db | Specifies whether the DB cluster is encrypted | `bool` | `false` | no |
| external\_data\_buckets | Buckets that are not managed by Apiary but added to Hive Metastore IAM role access. | `list(any)` | `[]` | no |
| external\_database\_host | External Metastore database host to support legacy installations, MySQL database won't be created by Apiary when this option is specified. | `string` | `""` | no |
| external\_database\_host\_readonly | External Metastore database host to support legacy installations. | `string` | `""` | no |

| hive\_metastore\_port | Port on which both Hive Metastore readwrite and readonly will run. | `number` | `9083` | no |
| hms\_additional\_environment\_variables | Additional environment variables for the Hive Metastore. | `map(any)` | `{}` | no |
| hms\_housekeeper\_additional\_environment\_variables | Additional environment variables for Hive Housekeeper. | `map(any)` | `{}` | no |
Expand Down
2 changes: 1 addition & 1 deletion k8s-readonly.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "kubernetes_deployment_v1" "apiary_hms_readonly" {

env {
name = "MYSQL_HOST"
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.endpoint) : var.external_database_host
value = var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)
}

env {
Expand Down
5 changes: 0 additions & 5 deletions s3-other.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ EOF

abort_incomplete_multipart_upload_days = var.s3_lifecycle_abort_incomplete_multipart_upload_days

transition {
days = 30
storage_class = "INTELLIGENT_TIERING"
}

expiration {
days = var.s3_log_expiry
}
Expand Down
2 changes: 1 addition & 1 deletion templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ locals{
})

hms_readonly_template = templatefile("${path.module}/templates/apiary-hms-readonly.json", {
mysql_db_host = "${var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : var.external_database_host}"
mysql_db_host = "${var.external_database_host == "" ? join("", aws_rds_cluster.apiary_cluster.*.reader_endpoint) : coalesce(var.external_database_host_readonly,var.external_database_host)}"
mysql_db_name = "${var.apiary_database_name}"
mysql_secret_arn = "${data.aws_secretsmanager_secret.db_ro_user.arn}"
hive_metastore_access_mode = "readonly"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ variable "external_database_host" {
default = ""
}

variable "external_database_host_readonly" {
description = "External Metastore database host readonly to support legacy installations"
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
Expand Down

0 comments on commit 2460749

Please sign in to comment.