Skip to content

Commit eab9756

Browse files
committed
Initial commit
1 parent 64a3a68 commit eab9756

File tree

8 files changed

+75
-87
lines changed

8 files changed

+75
-87
lines changed

examples/cluster/outputs.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
output "redshift_cluster_id" {
1+
output "cluster_id" {
22
description = "The ID of the Redshift cluster"
3-
value = module.redshift.redshift_cluster_id
3+
value = module.redshift.cluster_id
44
}
55

6-
output "redshift_cluster_endpoint" {
6+
output "cluster_endpoint" {
77
description = "The connection endpoint for the Redshift cluster"
8-
value = module.redshift.redshift_cluster_endpoint
8+
value = module.redshift.cluster_endpoint
99
}
1010

11-
output "redshift_endpoint" {
11+
output "endpoint" {
1212
description = "The endpoint of the Redshift deployment (either cluster or serverless)"
13-
value = module.redshift.redshift_endpoint
13+
value = module.redshift.endpoint
1414
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
locals {
2+
3+
aurora_mysql_zerotetl_parameters = {
4+
aurora_enhanced_binlog = {
5+
value = "1"
6+
apply_method = "pending-reboot"
7+
}
8+
binlog_backup = {
9+
value = "0"
10+
apply_method = "pending-reboot"
11+
}
12+
binlog_format = {
13+
value = "ROW"
14+
apply_method = "pending-reboot"
15+
}
16+
binlog_replication_globaldb = {
17+
value = "0"
18+
apply_method = "pending-reboot"
19+
}
20+
binlog_row_image = {
21+
value = "full"
22+
apply_method = "pending-reboot"
23+
}
24+
binlog_row_metadata = {
25+
value = "full"
26+
apply_method = "pending-reboot"
27+
}
28+
binlog_transaction_compression = {
29+
value = "OFF"
30+
apply_method = "pending-reboot"
31+
}
32+
binlog_row_value_options = {
33+
value = ""
34+
apply_method = "pending-reboot"
35+
}
36+
log_bin_trust_function_creators = {
37+
value = "1"
38+
apply_method = "pending-reboot"
39+
}
40+
}
41+
}

examples/rds-redshift-zero-etl/main.tf

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ module "redshift" {
125125
resource "aws_rds_integration" "this" {
126126
integration_name = "zero-etl-integration-1"
127127
source_arn = module.rds.arn
128-
target_arn = module.redshift.redshift_cluster_namespace_arn
128+
target_arn = module.redshift.cluster_namespace_arn
129129

130130
# data_filter = ""
131131

@@ -153,50 +153,8 @@ resource "aws_rds_cluster_parameter_group" "mysql_zerotetl" {
153153

154154
}
155155

156-
157-
locals {
158-
159-
aurora_mysql_zerotetl_parameters = {
160-
aurora_enhanced_binlog = {
161-
value = "1"
162-
apply_method = "pending-reboot"
163-
}
164-
binlog_backup = {
165-
value = "0"
166-
apply_method = "pending-reboot"
167-
}
168-
binlog_format = {
169-
value = "ROW"
170-
apply_method = "pending-reboot"
171-
}
172-
binlog_replication_globaldb = {
173-
value = "0"
174-
apply_method = "pending-reboot"
175-
}
176-
binlog_row_image = {
177-
value = "full"
178-
apply_method = "pending-reboot"
179-
}
180-
binlog_row_metadata = {
181-
value = "full"
182-
apply_method = "pending-reboot"
183-
}
184-
binlog_transaction_compression = {
185-
value = "OFF"
186-
apply_method = "pending-reboot"
187-
}
188-
binlog_row_value_options = {
189-
value = ""
190-
apply_method = "pending-reboot"
191-
}
192-
log_bin_trust_function_creators = {
193-
value = "1"
194-
apply_method = "pending-reboot"
195-
}
196-
}
197-
}
198156
resource "aws_redshift_resource_policy" "account" {
199-
resource_arn = module.redshift.redshift_cluster_namespace_arn
157+
resource_arn = module.redshift.cluster_namespace_arn
200158
policy = jsonencode({
201159
Version = "2012-10-17"
202160
Statement = [{
@@ -205,7 +163,7 @@ resource "aws_redshift_resource_policy" "account" {
205163
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
206164
}
207165
Action = "redshift:CreateInboundIntegration"
208-
Resource = module.redshift.redshift_cluster_namespace_arn
166+
Resource = module.redshift.cluster_namespace_arn
209167
Sid = ""
210168
},
211169
{

examples/rds-redshift-zero-etl/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ output "arn" {
1717

1818

1919
# Redshift outputs
20-
output "redshift_cluster_arn" {
20+
output "cluster_arn" {
2121
description = "The ARN of the Redshift cluster"
22-
value = module.redshift.redshift_cluster_arn
22+
value = module.redshift.cluster_arn
2323
}

examples/serverless/outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ output "kms_key_id" {
99
}
1010
output "serverless_namespace_id" {
1111
description = "The ID of the Redshift Serverless namespace"
12-
value = module.redshift_serverless.redshift_serverless_namespace_id
12+
value = module.redshift_serverless.serverless_namespace_id
1313
}
1414

1515
output "serverless_namespace_arn" {
1616
description = "The ARN of the Redshift Serverless namespace"
17-
value = module.redshift_serverless.redshift_serverless_namespace_arn
17+
value = module.redshift_serverless.serverless_namespace_arn
1818
}
1919

2020
output "serverless_workgroup_arn" {
2121
description = "The ARN of the Redshift Serverless workgroup"
22-
value = module.redshift_serverless.redshift_serverless_workgroup_arn
22+
value = module.redshift_serverless.serverless_workgroup_arn
2323
}

main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module "redshift_cluster" {
1616
cluster_identifier = var.cluster_identifier
1717
database_name = var.database_name
1818
master_username = var.master_username
19-
master_password = var.master_password
2019
manage_user_password = var.manage_user_password
2120
create_random_password = var.create_random_password
2221

outputs.tf

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,82 +3,72 @@
33
###############################################################################
44

55
# Conditional outputs for standard Redshift cluster
6-
output "redshift_cluster_id" {
6+
output "cluster_id" {
77
description = "The ID of the Redshift cluster"
88
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_id, null)
99
}
1010

11-
output "redshift_cluster_arn" {
11+
output "cluster_arn" {
1212
description = "The ARN of the Redshift cluster"
1313
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_arn, null)
1414
}
15-
output "redshift_cluster_namespace_arn" {
15+
output "cluster_namespace_arn" {
1616
description = "The ARN of the Redshift cluster"
1717
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_namespace_arn, null)
1818
}
1919

20-
output "redshift_cluster_endpoint" {
20+
output "cluster_endpoint" {
2121
description = "The connection endpoint for the Redshift cluster"
2222
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_endpoint, null)
2323
}
2424

25-
output "redshift_cluster_hostname" {
25+
output "cluster_hostname" {
2626
description = "The hostname of the Redshift cluster"
2727
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_hostname, null)
2828
}
2929

30-
output "redshift_cluster_port" {
30+
output "cluster_port" {
3131
description = "The port of the Redshift cluster"
3232
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_port, null)
3333
}
3434

35-
output "redshift_cluster_database_name" {
35+
output "cluster_database_name" {
3636
description = "The name of the default database in the Redshift cluster"
3737
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_cluster_database_name, null)
3838
}
3939

40-
output "redshift_cluster_security_group_id" {
40+
output "cluster_security_group_id" {
4141
description = "The ID of the security group associated with the Redshift cluster"
4242
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_security_group_id, null)
4343
}
4444

45-
output "redshift_subnet_group_id" {
46-
description = "The ID of the Redshift subnet group"
47-
value = var.enable_serverless ? null : try(module.redshift_cluster[0].redshift_subnet_group_id, null)
48-
}
49-
5045
# Conditional outputs for Redshift Serverless
51-
output "redshift_serverless_namespace_id" {
46+
output "serverless_namespace_id" {
5247
description = "The ID of the Redshift Serverless namespace"
5348
value = var.enable_serverless ? try(module.redshift_serverless[0].redshift_serverless_namespace_id, null) : null
5449
}
5550

56-
output "redshift_serverless_namespace_arn" {
51+
output "serverless_namespace_arn" {
5752
description = "The ARN of the Redshift Serverless namespace"
5853
value = var.enable_serverless ? try(module.redshift_serverless[0].redshift_serverless_namespace_arn, null) : null
5954
}
6055

61-
output "redshift_serverless_workgroup_id" {
56+
output "serverless_workgroup_id" {
6257
description = "The ID of the Redshift Serverless workgroup"
6358
value = var.enable_serverless ? try(module.redshift_serverless[0].redshift_serverless_workgroup_id, null) : null
6459
}
6560

66-
output "redshift_serverless_workgroup_arn" {
61+
output "serverless_workgroup_arn" {
6762
description = "The ARN of the Redshift Serverless workgroup"
6863
value = var.enable_serverless ? try(module.redshift_serverless[0].redshift_serverless_workgroup_arn, null) : null
6964
}
70-
output "redshift_serverless_endpoint" {
65+
output "serverless_endpoint" {
7166
description = "The endpoint URL for the Redshift Serverless workgroup"
7267
value = var.enable_serverless ? try(module.redshift_serverless[0].redshift_serverless_endpoint, null) : null
7368
}
7469

7570
# Common outputs
76-
output "redshift_endpoint" {
71+
output "endpoint" {
7772
description = "The endpoint of the Redshift deployment (either cluster or serverless)"
7873
value = var.enable_serverless ? try(module.redshift_serverless[0].redshift_serverless_endpoint, null) : try(module.redshift_cluster[0].redshift_cluster_endpoint, null)
7974
}
80-
81-
output "redshift_database_name" {
82-
description = "The name of the database in the Redshift deployment"
83-
value = var.database_name
84-
}

variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ variable "additional_security_group_ids" {
9898
type = list(string)
9999
default = []
100100
}
101-
variable "master_password" {
102-
description = "Password for the master DB user. If null, a random password will be generated"
103-
type = string
104-
sensitive = true
105-
default = null
106-
}
101+
# variable "master_password" {
102+
# description = "Password for the master DB user. If null, a random password will be generated"
103+
# type = string
104+
# sensitive = true
105+
# default = null
106+
# }
107107

108108
variable "manage_user_password" {
109109
description = "Set to true to allow RDS to manage the master user password in Secrets Manager"

0 commit comments

Comments
 (0)