From 88fe67c9e2dd337bc630db7691d0fe569a79d201 Mon Sep 17 00:00:00 2001 From: pradeepbhadani Date: Thu, 10 Jan 2019 19:41:51 +0000 Subject: [PATCH] Add option to set `apply_immediately` flag for RDS (#95) * fixes #94, variable to set apply_immediately flag for RDS --- CHANGELOG.md | 3 +++ VARIABLES.md | 5 +++-- db.tf | 1 + variables.tf | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b90dd4..8e649a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added +- Add `db_apply_immediately` variable to fix [#94](https://github.com/ExpediaInc/apiary-data-lake/issues/94). + ### Changed - Fixed ECS widgets in CloudWatch dashboard - see [#89](https://github.com/ExpediaInc/apiary-data-lake/issues/89). diff --git a/VARIABLES.md b/VARIABLES.md index b59ce9f..82cbb9f 100644 --- a/VARIABLES.md +++ b/VARIABLES.md @@ -10,11 +10,12 @@ | apiary_log_bucket | Bucket for Apiary logs. | string | - | yes | | apiary_log_prefix | Prefix for Apiary logs. | string | `` | no | | apiary_managed_schemas | Schema names from which S3 bucket names will be derived, corresponding S3 bucket will be named as apiary_instance-aws_account-aws_region-schema_name. | list | `` | no | -| apiary_shared_schemas | Schema names which are accessible from read-only metastore, default is all schemas. | list | `` | no | | apiary_producer_iamroles | AWS IAM roles allowed write access to managed Apiary S3 buckets. | map | `` | no | | apiary_rds_additional_sg | Comma-separated string containing additional security groups to attach to RDS. | list | `` | no | +| apiary_shared_schemas | Schema names which are accessible from read-only metastore, default is all schemas. | list | `` | no | | apiary_tags | Common tags that get put on all resources. | map | - | yes | | aws_region | AWS region. | string | - | yes | +| db_apply_immediately | Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. | string | `false` | no | | db_backup_retention | The number of days to retain backups for the RDS Metastore DB. | string | - | yes | | db_backup_window | Preferred backup window for the RDS Metastore DB in UTC. | string | `02:00-03:00` | no | | db_instance_class | Instance type for the RDS Metastore DB. | string | - | yes | @@ -25,11 +26,11 @@ | db_rw_secret_name | Aurora cluster MySQL read/write user SecretsManager secret name. | string | `` | no | | ecs_domain_extension | Domain name to use for hosted zone created by ECS service discovery. | string | `lcl` | no | | elb_timeout | Idle timeout for Apiary ELB. | string | `1800` | no | -| enable_s3_paid_metrics | Enable managed S3 buckets request and data transfer metrics. | string | `` | no | | enable_data_events | Enable managed buckets S3 event notifications. | string | `` | no | | enable_gluesync | Enable metadata sync from Hive to the Glue catalog. | string | `` | no | | enable_hive_metastore_metrics | Enable sending Hive Metastore metrics to CloudWatch. | string | `` | no | | enable_metadata_events | Enable Hive Metastore SNS listener. | string | `` | no | +| enable_s3_paid_metrics | Enable managed S3 buckets request and data transfer metrics. | string | `` | no | | external_data_buckets | Buckets that are not managed by Apiary but added to Hive Metastore IAM role access. | list | `` | 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 | | hms_docker_image | Docker image ID for the Hive Metastore. | string | - | yes | diff --git a/db.tf b/db.tf index e2d71a6..006b0b9 100644 --- a/db.tf +++ b/db.tf @@ -68,6 +68,7 @@ resource "aws_rds_cluster" "apiary_cluster" { tags = "${var.apiary_tags}" final_snapshot_identifier = "${local.instance_alias}-cluster-final-${random_id.snapshot_id.hex}" iam_database_authentication_enabled = true + apply_immediately = "${var.db_apply_immediately}" lifecycle { create_before_destroy = true diff --git a/variables.tf b/variables.tf index b7906be..8180b75 100644 --- a/variables.tf +++ b/variables.tf @@ -140,6 +140,12 @@ variable "db_backup_retention" { type = "string" } +variable "db_apply_immediately" { + description = "Specifies whether any cluster modifications are applied immediately, or during the next maintenance window." + type = "string" + default = "false" +} + variable "db_backup_window" { description = "Preferred backup window for the RDS Metastore DB in UTC." type = "string"