Skip to content

Commit 7c86caa

Browse files
committed
Final snapshot, logging, and instance types
- Updated the list of instance types - Added `final_snapshot_identifier` functionality - Adding `logging` block functionality
1 parent fc6c31e commit 7c86caa

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ resource "aws_redshift_cluster" "this" {
2323
publicly_accessible = "${var.publicly_accessible}"
2424

2525
# Snapshots and backups
26+
final_snapshot_identifier = "${var.final_snapshot_identifier}"
2627
skip_final_snapshot = "${var.skip_final_snapshot}"
2728
automated_snapshot_retention_period = "${var.automated_snapshot_retention_period }"
2829
preferred_maintenance_window = "${var.preferred_maintenance_window}"
@@ -43,6 +44,12 @@ resource "aws_redshift_cluster" "this" {
4344
lifecycle {
4445
prevent_destroy = true
4546
}
47+
48+
logging {
49+
enable = "${var.enable_logging}"
50+
bucket_name = "${var.logging_bucket_name}"
51+
s3_key_prefix = "${var.logging_s3_key_prefix}"
52+
}
4653
}
4754

4855
resource "aws_redshift_parameter_group" "this" {

variables.tf

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ variable "cluster_version" {
1515
variable "cluster_node_type" {
1616
description = "Node Type of Redshift cluster"
1717

18-
# Valid Values: ds1.xlarge | ds1.8xlarge | ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge.
18+
# Valid Values: ds2.xlarge | ds2.8xlarge | ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge | dc2.large | dc2.8xlarge.
1919
# http://docs.aws.amazon.com/cli/latest/reference/redshift/create-cluster.html
2020
}
2121

@@ -76,6 +76,12 @@ variable "vpc_security_group_ids" {
7676
default = []
7777
}
7878

79+
# Snapshots and maintenance windows
80+
variable "final_snapshot_identifier" {
81+
description = "(Optional) The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, 'skip_final_snapshot' must be false."
82+
default = false
83+
}
84+
7985
variable "skip_final_snapshot" {
8086
description = "If true (default), no snapshot will be made before deleting DB"
8187
default = true
@@ -91,6 +97,22 @@ variable "automated_snapshot_retention_period" {
9197
default = 0
9298
}
9399

100+
# Logging
101+
variable "enable_logging" {
102+
description = "Enables logging information such as queries and connection attempts, for the specified Amazon Redshift cluster."
103+
default = false
104+
}
105+
106+
variable "logging_bucket_name" {
107+
description = "(Optional, required when enable_logging is true) The name of an existing S3 bucket where the log files are to be stored. Must be in the same region as the cluster and the cluster must have read bucket and put object permissions."
108+
default = false
109+
}
110+
111+
variable "logging_s3_key_prefix" {
112+
description = "(Optional) The prefix applied to the log file names."
113+
default = false
114+
}
115+
94116
variable "wlm_json_configuration" {
95117
default = "[{\"query_concurrency\": 5}]"
96118
}

0 commit comments

Comments
 (0)