File tree Expand file tree Collapse file tree 5 files changed +35
-1
lines changed Expand file tree Collapse file tree 5 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ module "redshift_cluster" {
33
33
security_group_data = var. security_group_data
34
34
security_group_name = var. security_group_name
35
35
create_security_groups = var. create_security_groups
36
+ redshift_logging = var. redshift_logging
36
37
37
38
38
39
# Snapshot configuration
Original file line number Diff line number Diff line change @@ -56,6 +56,14 @@ resource "aws_ssm_parameter" "redshift_master_password" {
56
56
tags = var. tags
57
57
58
58
}
59
+ resource "aws_redshift_logging" "example" {
60
+ count = var. redshift_logging . enable ? 1 : 0
61
+ cluster_identifier = local. cluster_identifier
62
+ log_destination_type = var. redshift_logging . log_destination_type
63
+ bucket_name = var. redshift_logging . bucket_name
64
+ s3_key_prefix = var. redshift_logging . s3_key_prefix
65
+ }
66
+
59
67
60
68
resource "aws_redshift_cluster" "this" {
61
69
cluster_identifier = local. cluster_identifier
Original file line number Diff line number Diff line change @@ -59,6 +59,19 @@ variable "number_of_nodes" {
59
59
default = 1
60
60
}
61
61
62
+ variable "redshift_logging" {
63
+ description = " Configuration for Redshift logging"
64
+ type = object ({
65
+ enable = optional (bool , false )
66
+ bucket_name = optional (string , null )
67
+ s3_key_prefix = optional (string , " redshift-logs/" )
68
+ log_destination_type = optional (string , " s3" )
69
+ })
70
+ default = {
71
+ enable = false
72
+ }
73
+ }
74
+
62
75
variable "cluster_type" {
63
76
description = " The cluster type to use. Either 'single-node' or 'multi-node'"
64
77
type = string
Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ variable "admin_username" {
46
46
default = null
47
47
}
48
48
49
-
50
49
variable "manage_admin_password" {
51
50
description = " Whether to allow Redshift to manage the admin password automatically"
52
51
type = bool
Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ variable "create_security_groups" {
54
54
type = bool
55
55
default = true
56
56
}
57
+ variable "redshift_logging" {
58
+ description = " Configuration for Redshift logging"
59
+ type = object ({
60
+ enable = optional (bool , false )
61
+ bucket_name = optional (string , null )
62
+ s3_key_prefix = optional (string , " redshift-logs/" )
63
+ log_destination_type = optional (string , " s3" )
64
+ })
65
+ default = {
66
+ enable = false
67
+ }
68
+ }
69
+
57
70
variable "create_random_password" {
58
71
description = " Determines whether to create random password for cluster `master_password`"
59
72
type = bool
You can’t perform that action at this time.
0 commit comments