/
getCluster.go
259 lines (219 loc) · 15.5 KB
/
getCluster.go
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets details of a single Cluster.
func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupClusterResult
err := ctx.Invoke("google-native:alloydb/v1:getCluster", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupClusterArgs struct {
ClusterId string `pulumi:"clusterId"`
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
View *string `pulumi:"view"`
}
type LookupClusterResult struct {
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128
Annotations map[string]string `pulumi:"annotations"`
// The automated backup policy for this cluster. If no policy is provided then the default policy will be used. If backups are supported for the cluster, the default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. For more information on the defaults, consult the documentation for the message type.
AutomatedBackupPolicy AutomatedBackupPolicyResponse `pulumi:"automatedBackupPolicy"`
// Cluster created from backup.
BackupSource BackupSourceResponse `pulumi:"backupSource"`
// The type of the cluster. This is an output-only field and it's populated at the Cluster creation time or the Cluster promotion time. The cluster type is determined by which RPC was used to create the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
ClusterType string `pulumi:"clusterType"`
// Optional. Continuous backup configuration for this cluster.
ContinuousBackupConfig ContinuousBackupConfigResponse `pulumi:"continuousBackupConfig"`
// Continuous backup properties for this cluster.
ContinuousBackupInfo ContinuousBackupInfoResponse `pulumi:"continuousBackupInfo"`
// Create time stamp
CreateTime string `pulumi:"createTime"`
// Optional. The database engine major version. This is an optional field and it is populated at the Cluster creation time. If a database version is not supplied at cluster creation time, then a default database version will be used.
DatabaseVersion string `pulumi:"databaseVersion"`
// Delete time stamp
DeleteTime string `pulumi:"deleteTime"`
// User-settable and human-readable display name for the Cluster.
DisplayName string `pulumi:"displayName"`
// Optional. The encryption config can be specified to encrypt the data disks and other persistent data resources of a cluster with a customer-managed encryption key (CMEK). When this field is not specified, the cluster will then use default encryption scheme to protect the user data.
EncryptionConfig EncryptionConfigResponse `pulumi:"encryptionConfig"`
// The encryption information for the cluster.
EncryptionInfo EncryptionInfoResponse `pulumi:"encryptionInfo"`
// For Resource freshness validation (https://google.aip.dev/154)
Etag string `pulumi:"etag"`
// Input only. Initial user to setup during cluster creation. Required. If used in `RestoreCluster` this is ignored.
InitialUser UserPasswordResponse `pulumi:"initialUser"`
// Labels as key value pairs
Labels map[string]string `pulumi:"labels"`
// Cluster created via DMS migration.
MigrationSource MigrationSourceResponse `pulumi:"migrationSource"`
// The name of the cluster resource with the format: * projects/{project}/locations/{region}/clusters/{cluster_id} where the cluster ID segment should satisfy the regex expression `[a-z0-9-]+`. For more details see https://google.aip.dev/122. The prefix of the cluster resource name is the name of the parent resource: * projects/{project}/locations/{region}
Name string `pulumi:"name"`
// The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: "projects/{project}/global/networks/{network_id}". This is required to create a cluster. Deprecated, use network_config.network instead.
//
// Deprecated: Required. The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: "projects/{project}/global/networks/{network_id}". This is required to create a cluster. Deprecated, use network_config.network instead.
Network string `pulumi:"network"`
NetworkConfig NetworkConfigResponse `pulumi:"networkConfig"`
// Cross Region replication config specific to PRIMARY cluster.
PrimaryConfig PrimaryConfigResponse `pulumi:"primaryConfig"`
// Reconciling (https://google.aip.dev/128#reconciliation). Set to true if the current state of Cluster does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.
Reconciling bool `pulumi:"reconciling"`
// Cross Region replication config specific to SECONDARY cluster.
SecondaryConfig SecondaryConfigResponse `pulumi:"secondaryConfig"`
// SSL configuration for this AlloyDB cluster.
SslConfig SslConfigResponse `pulumi:"sslConfig"`
// The current serving state of the cluster.
State string `pulumi:"state"`
// The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.
Uid string `pulumi:"uid"`
// Update time stamp
UpdateTime string `pulumi:"updateTime"`
}
func LookupClusterOutput(ctx *pulumi.Context, args LookupClusterOutputArgs, opts ...pulumi.InvokeOption) LookupClusterResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupClusterResult, error) {
args := v.(LookupClusterArgs)
r, err := LookupCluster(ctx, &args, opts...)
var s LookupClusterResult
if r != nil {
s = *r
}
return s, err
}).(LookupClusterResultOutput)
}
type LookupClusterOutputArgs struct {
ClusterId pulumi.StringInput `pulumi:"clusterId"`
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
View pulumi.StringPtrInput `pulumi:"view"`
}
func (LookupClusterOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupClusterArgs)(nil)).Elem()
}
type LookupClusterResultOutput struct{ *pulumi.OutputState }
func (LookupClusterResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupClusterResult)(nil)).Elem()
}
func (o LookupClusterResultOutput) ToLookupClusterResultOutput() LookupClusterResultOutput {
return o
}
func (o LookupClusterResultOutput) ToLookupClusterResultOutputWithContext(ctx context.Context) LookupClusterResultOutput {
return o
}
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128
func (o LookupClusterResultOutput) Annotations() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupClusterResult) map[string]string { return v.Annotations }).(pulumi.StringMapOutput)
}
// The automated backup policy for this cluster. If no policy is provided then the default policy will be used. If backups are supported for the cluster, the default policy takes one backup a day, has a backup window of 1 hour, and retains backups for 14 days. For more information on the defaults, consult the documentation for the message type.
func (o LookupClusterResultOutput) AutomatedBackupPolicy() AutomatedBackupPolicyResponseOutput {
return o.ApplyT(func(v LookupClusterResult) AutomatedBackupPolicyResponse { return v.AutomatedBackupPolicy }).(AutomatedBackupPolicyResponseOutput)
}
// Cluster created from backup.
func (o LookupClusterResultOutput) BackupSource() BackupSourceResponseOutput {
return o.ApplyT(func(v LookupClusterResult) BackupSourceResponse { return v.BackupSource }).(BackupSourceResponseOutput)
}
// The type of the cluster. This is an output-only field and it's populated at the Cluster creation time or the Cluster promotion time. The cluster type is determined by which RPC was used to create the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster`
func (o LookupClusterResultOutput) ClusterType() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.ClusterType }).(pulumi.StringOutput)
}
// Optional. Continuous backup configuration for this cluster.
func (o LookupClusterResultOutput) ContinuousBackupConfig() ContinuousBackupConfigResponseOutput {
return o.ApplyT(func(v LookupClusterResult) ContinuousBackupConfigResponse { return v.ContinuousBackupConfig }).(ContinuousBackupConfigResponseOutput)
}
// Continuous backup properties for this cluster.
func (o LookupClusterResultOutput) ContinuousBackupInfo() ContinuousBackupInfoResponseOutput {
return o.ApplyT(func(v LookupClusterResult) ContinuousBackupInfoResponse { return v.ContinuousBackupInfo }).(ContinuousBackupInfoResponseOutput)
}
// Create time stamp
func (o LookupClusterResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// Optional. The database engine major version. This is an optional field and it is populated at the Cluster creation time. If a database version is not supplied at cluster creation time, then a default database version will be used.
func (o LookupClusterResultOutput) DatabaseVersion() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.DatabaseVersion }).(pulumi.StringOutput)
}
// Delete time stamp
func (o LookupClusterResultOutput) DeleteTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.DeleteTime }).(pulumi.StringOutput)
}
// User-settable and human-readable display name for the Cluster.
func (o LookupClusterResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// Optional. The encryption config can be specified to encrypt the data disks and other persistent data resources of a cluster with a customer-managed encryption key (CMEK). When this field is not specified, the cluster will then use default encryption scheme to protect the user data.
func (o LookupClusterResultOutput) EncryptionConfig() EncryptionConfigResponseOutput {
return o.ApplyT(func(v LookupClusterResult) EncryptionConfigResponse { return v.EncryptionConfig }).(EncryptionConfigResponseOutput)
}
// The encryption information for the cluster.
func (o LookupClusterResultOutput) EncryptionInfo() EncryptionInfoResponseOutput {
return o.ApplyT(func(v LookupClusterResult) EncryptionInfoResponse { return v.EncryptionInfo }).(EncryptionInfoResponseOutput)
}
// For Resource freshness validation (https://google.aip.dev/154)
func (o LookupClusterResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Etag }).(pulumi.StringOutput)
}
// Input only. Initial user to setup during cluster creation. Required. If used in `RestoreCluster` this is ignored.
func (o LookupClusterResultOutput) InitialUser() UserPasswordResponseOutput {
return o.ApplyT(func(v LookupClusterResult) UserPasswordResponse { return v.InitialUser }).(UserPasswordResponseOutput)
}
// Labels as key value pairs
func (o LookupClusterResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupClusterResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// Cluster created via DMS migration.
func (o LookupClusterResultOutput) MigrationSource() MigrationSourceResponseOutput {
return o.ApplyT(func(v LookupClusterResult) MigrationSourceResponse { return v.MigrationSource }).(MigrationSourceResponseOutput)
}
// The name of the cluster resource with the format: * projects/{project}/locations/{region}/clusters/{cluster_id} where the cluster ID segment should satisfy the regex expression `[a-z0-9-]+`. For more details see https://google.aip.dev/122. The prefix of the cluster resource name is the name of the parent resource: * projects/{project}/locations/{region}
func (o LookupClusterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Name }).(pulumi.StringOutput)
}
// The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: "projects/{project}/global/networks/{network_id}". This is required to create a cluster. Deprecated, use network_config.network instead.
//
// Deprecated: Required. The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: "projects/{project}/global/networks/{network_id}". This is required to create a cluster. Deprecated, use network_config.network instead.
func (o LookupClusterResultOutput) Network() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Network }).(pulumi.StringOutput)
}
func (o LookupClusterResultOutput) NetworkConfig() NetworkConfigResponseOutput {
return o.ApplyT(func(v LookupClusterResult) NetworkConfigResponse { return v.NetworkConfig }).(NetworkConfigResponseOutput)
}
// Cross Region replication config specific to PRIMARY cluster.
func (o LookupClusterResultOutput) PrimaryConfig() PrimaryConfigResponseOutput {
return o.ApplyT(func(v LookupClusterResult) PrimaryConfigResponse { return v.PrimaryConfig }).(PrimaryConfigResponseOutput)
}
// Reconciling (https://google.aip.dev/128#reconciliation). Set to true if the current state of Cluster does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.
func (o LookupClusterResultOutput) Reconciling() pulumi.BoolOutput {
return o.ApplyT(func(v LookupClusterResult) bool { return v.Reconciling }).(pulumi.BoolOutput)
}
// Cross Region replication config specific to SECONDARY cluster.
func (o LookupClusterResultOutput) SecondaryConfig() SecondaryConfigResponseOutput {
return o.ApplyT(func(v LookupClusterResult) SecondaryConfigResponse { return v.SecondaryConfig }).(SecondaryConfigResponseOutput)
}
// SSL configuration for this AlloyDB cluster.
func (o LookupClusterResultOutput) SslConfig() SslConfigResponseOutput {
return o.ApplyT(func(v LookupClusterResult) SslConfigResponse { return v.SslConfig }).(SslConfigResponseOutput)
}
// The current serving state of the cluster.
func (o LookupClusterResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.State }).(pulumi.StringOutput)
}
// The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.
func (o LookupClusterResultOutput) Uid() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Uid }).(pulumi.StringOutput)
}
// Update time stamp
func (o LookupClusterResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupClusterResultOutput{})
}