-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.tf
More file actions
102 lines (80 loc) · 3.56 KB
/
main.tf
File metadata and controls
102 lines (80 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
###############################################################################
#################### Standard Redshift Module Call ###################
###############################################################################
module "redshift_cluster" {
count = var.enable_serverless ? 0 : 1
source = "./modules/redshift-cluster"
# Basic configuration
namespace = var.namespace
environment = var.environment
name = var.name
# Cluster configuration
cluster_identifier = var.cluster_identifier
database_name = var.database_name
master_username = var.master_username
manage_user_password = var.manage_user_password
create_random_password = var.create_random_password
# Node configuration
node_type = var.node_type
number_of_nodes = var.number_of_nodes
cluster_type = var.cluster_type
# Network configuration
vpc_id = var.vpc_id
subnet_ids = var.subnet_ids
cluster_subnet_group_name = var.cluster_subnet_group_name
cluster_parameter_group_name = var.cluster_parameter_group_name
security_group_data = var.security_group_data
security_group_name = var.security_group_name
create_security_groups = var.create_security_groups
redshift_logging = var.redshift_logging
# Snapshot configuration
skip_final_snapshot = var.skip_final_snapshot
final_snapshot_identifier = var.final_snapshot_identifier
snapshot_identifier = var.snapshot_identifier
automated_snapshot_retention_period = var.automated_snapshot_retention_period
# Other configuration
port = var.port
publicly_accessible = var.publicly_accessible
enhanced_vpc_routing = var.enhanced_vpc_routing
kms_key_id = var.kms_key_id
encrypted = var.encrypted
allow_version_upgrade = var.allow_version_upgrade
preferred_maintenance_window = var.preferred_maintenance_window
# Tags - pass through the tags from the calling module
tags = var.tags
}
###############################################################################
#################### Serverless Redshift Module Call ##################
###############################################################################
module "redshift_serverless" {
count = var.enable_serverless ? 1 : 0
source = "./modules/redshift-serverless"
# Basic configuration
namespace = var.namespace
environment = var.environment
name = var.name
# Serverless configuration
namespace_name = var.namespace_name
workgroup_name = var.workgroup_name
base_capacity = var.base_capacity
max_capacity = var.max_capacity
# Database configuration
db_name = var.database_name
admin_username = var.admin_username
manage_admin_password = var.manage_admin_password
create_random_password = var.create_random_password
create_security_groups = var.create_security_groups
vpc_id = var.vpc_id
subnet_ids = var.subnet_ids
port = var.port
enhanced_vpc_routing = var.enhanced_vpc_routing
track_name = var.track_name
publicly_accessible = var.publicly_accessible
config_parameters = var.config_parameters
kms_key_id = var.kms_key_id
security_group_name = var.security_group_name
additional_security_group_ids = var.additional_security_group_ids
security_group_data = var.security_group_data
# Tags - pass through the tags from the calling module
tags = var.tags
}