Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a variable for cloudwatch_log_group_skip_destroy_on_deletion. Deploy user will start supporting deletions today #28

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Terraform module for AWS RDS instances
| <a name="input_character_set_name"></a> [character\_set\_name](#input\_character\_set\_name) | The character set name to use for DB encoding in Oracle instances. This can't be changed. See Oracle Character Sets Supported in Amazon RDS and Collations and Character Sets for Microsoft SQL Server for more information. This can only be set on creation | `string` | `null` | no |
| <a name="input_cloudwatch_log_group_kms_key_id"></a> [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | The ARN of the KMS Key to use when encrypting log data | `string` | `null` | no |
| <a name="input_cloudwatch_log_group_retention_in_days"></a> [cloudwatch\_log\_group\_retention\_in\_days](#input\_cloudwatch\_log\_group\_retention\_in\_days) | The number of days to retain CloudWatch logs for the DB instance | `number` | `1` | no |
| <a name="input_cloudwatch_log_group_skip_destroy_on_deletion"></a> [cloudwatch\_log\_group\_skip\_destroy\_on\_deletion](#input\_cloudwatch\_log\_group\_skip\_destroy\_on\_deletion) | Should we skip to destroy CloudWatch log group on deletion? | `bool` | `false` | no |
| <a name="input_cluster_activity_stream_kms_key_id"></a> [cluster\_activity\_stream\_kms\_key\_id](#input\_cluster\_activity\_stream\_kms\_key\_id) | The AWS KMS key identifier for encrypting messages in the database activity stream | `string` | `null` | no |
| <a name="input_cluster_activity_stream_mode"></a> [cluster\_activity\_stream\_mode](#input\_cluster\_activity\_stream\_mode) | Specifies the mode of the database activity stream. Database events such as a change or access generate an activity stream event. One of: sync, async | `string` | `null` | no |
| <a name="input_cluster_autoscaling_enabled"></a> [cluster\_autoscaling\_enabled](#input\_cluster\_autoscaling\_enabled) | Determines whether autoscaling of the cluster read replicas is enabled | `bool` | `false` | no |
Expand Down
3 changes: 1 addition & 2 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ locals {
########################################################################
# CloudWatch log group config
########################################################################
create_cloudwatch_log_group = length(var.enabled_cloudwatch_logs_exports) > 0
cloudwatch_log_group_skip_destroy_on_deletion = true
create_cloudwatch_log_group = length(var.enabled_cloudwatch_logs_exports) > 0

########################################################################
# DB Proxy configuration
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module "cw_log_group" {
enabled_cw_logs_exports = var.enabled_cloudwatch_logs_exports
cw_log_group_retention_in_days = var.cloudwatch_log_group_retention_in_days
cw_log_group_kms_key_id = var.cloudwatch_log_group_kms_key_id
cw_log_group_skip_destroy_on_deletion = local.cloudwatch_log_group_skip_destroy_on_deletion
cw_log_group_skip_destroy_on_deletion = var.cloudwatch_log_group_skip_destroy_on_deletion
}

module "enhanced_monitoring_iam_role" {
Expand Down Expand Up @@ -224,7 +224,7 @@ module "db_proxy" {
db_cluster_identifier = var.identifier
endpoints = {}
manage_log_group = true
cw_log_group_skip_destroy_on_deletion = local.cloudwatch_log_group_skip_destroy_on_deletion
cw_log_group_skip_destroy_on_deletion = var.cloudwatch_log_group_skip_destroy_on_deletion
log_group_retention_in_days = var.cloudwatch_log_group_retention_in_days
log_group_kms_key_id = var.cloudwatch_log_group_kms_key_id
log_group_tags = var.tags
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ variable "cloudwatch_log_group_kms_key_id" {
default = null
}

variable "cloudwatch_log_group_skip_destroy_on_deletion" {
description = "Should we skip to destroy CloudWatch log group on deletion?"
type = bool
default = false
}

################################################################################
# Cluster specific variables
################################################################################
Expand Down