-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputs.tf
More file actions
138 lines (110 loc) · 5.82 KB
/
Copy pathoutputs.tf
File metadata and controls
138 lines (110 loc) · 5.82 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
###############################################################################
# Primary outputs — id + arn (cross-resource reference type) + tags_all
###############################################################################
output "id" {
description = "ID of the warehouse — cluster identifier (provisioned) or namespace id (serverless)."
value = try(aws_redshift_cluster.this["this"].id, aws_redshiftserverless_namespace.this["this"].id, null)
}
output "arn" {
description = "ARN of the warehouse (cross-resource reference type) — the cluster ARN (provisioned) or the namespace ARN (serverless)."
value = try(aws_redshift_cluster.this["this"].arn, aws_redshiftserverless_namespace.this["this"].arn, null)
}
output "name" {
description = "Base name of the warehouse (var.name)."
value = var.name
}
output "deployment_mode" {
description = "Deployment shape in use — `provisioned` or `serverless`."
value = var.deployment_mode
}
output "tags_all" {
description = "All tags on the keystone resource, including those inherited from provider default_tags (resource tags win on key conflict)."
value = try(aws_redshift_cluster.this["this"].tags_all, aws_redshiftserverless_namespace.this["this"].tags_all, null)
}
###############################################################################
# Connectivity
###############################################################################
output "endpoint" {
description = "Connection endpoint — `host:port` for a provisioned cluster, or the workgroup endpoint address for serverless."
value = try(aws_redshift_cluster.this["this"].endpoint, aws_redshiftserverless_workgroup.this["this"].endpoint[0].address, null)
}
output "port" {
description = "Port the warehouse accepts connections on (default 5439)."
value = try(aws_redshift_cluster.this["this"].port, aws_redshiftserverless_workgroup.this["this"].endpoint[0].port, null)
}
output "database_name" {
description = "Name of the initial database in the warehouse."
value = try(aws_redshift_cluster.this["this"].database_name, aws_redshiftserverless_namespace.this["this"].db_name, null)
}
output "dns_name" {
description = "(provisioned) DNS name of the cluster. Null in serverless mode."
value = try(aws_redshift_cluster.this["this"].dns_name, null)
}
###############################################################################
# Provisioned cluster
###############################################################################
output "cluster_identifier" {
description = "(provisioned) Cluster identifier. Null in serverless mode."
value = try(aws_redshift_cluster.this["this"].cluster_identifier, null)
}
output "cluster_namespace_arn" {
description = "(provisioned) Namespace ARN of the cluster. Null in serverless mode."
value = try(aws_redshift_cluster.this["this"].cluster_namespace_arn, null)
}
output "cluster_revision_number" {
description = "(provisioned) Cluster revision number. Null in serverless mode."
value = try(aws_redshift_cluster.this["this"].cluster_revision_number, null)
}
output "master_password_secret_arn" {
description = "ARN of the Secrets Manager secret holding the admin password when `manage_admin_password = true` (provisioned: cluster secret, serverless: namespace secret). Null otherwise."
value = try(aws_redshift_cluster.this["this"].master_password_secret_arn, aws_redshiftserverless_namespace.this["this"].admin_password_secret_arn, null)
}
###############################################################################
# Serverless namespace + workgroup
###############################################################################
output "namespace_arn" {
description = "(serverless) Namespace ARN. Null in provisioned mode."
value = try(aws_redshiftserverless_namespace.this["this"].arn, null)
}
output "namespace_id" {
description = "(serverless) Namespace id (UUID). Null in provisioned mode."
value = try(aws_redshiftserverless_namespace.this["this"].namespace_id, null)
}
output "namespace_name" {
description = "(serverless) Namespace name. Null in provisioned mode."
value = try(aws_redshiftserverless_namespace.this["this"].namespace_name, null)
}
output "workgroup_arn" {
description = "(serverless) Workgroup ARN. Null in provisioned mode."
value = try(aws_redshiftserverless_workgroup.this["this"].arn, null)
}
output "workgroup_id" {
description = "(serverless) Workgroup id. Null in provisioned mode."
value = try(aws_redshiftserverless_workgroup.this["this"].workgroup_id, null)
}
output "workgroup_name" {
description = "(serverless) Workgroup name. Null in provisioned mode."
value = try(aws_redshiftserverless_workgroup.this["this"].workgroup_name, null)
}
###############################################################################
# Subnet group (provisioned)
###############################################################################
output "subnet_group_name" {
description = "(provisioned) Name of the cluster subnet group created by this module. Null in serverless mode."
value = try(aws_redshift_subnet_group.this["this"].name, null)
}
output "subnet_group_arn" {
description = "(provisioned) ARN of the cluster subnet group created by this module. Null in serverless mode."
value = try(aws_redshift_subnet_group.this["this"].arn, null)
}
###############################################################################
# Parameter group (provisioned)
###############################################################################
output "parameter_group_name" {
description = "Name of the parameter group associated with the cluster (module-created, caller-supplied, or null for the engine default)."
value = try(aws_redshift_parameter_group.this["this"].name, var.parameter_group_name, null)
}
output "parameter_group_arn" {
description = "ARN of the parameter group created by this module (null when none is created)."
value = try(aws_redshift_parameter_group.this["this"].arn, null)
}