/
getCluster.go
164 lines (137 loc) · 7.46 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
// 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 the details of a specific Redis 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:redis/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"`
}
type LookupClusterResult struct {
// Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.
AuthorizationMode string `pulumi:"authorizationMode"`
// The timestamp associated with the cluster creation request.
CreateTime string `pulumi:"createTime"`
// Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one discovery endpoint is supported.
DiscoveryEndpoints []DiscoveryEndpointResponse `pulumi:"discoveryEndpoints"`
// Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
Name string `pulumi:"name"`
// Each PscConfig configures the consumer network where IPs will be designated to the cluster for client access through Private Service Connect Automation. Currently, only one PscConfig is supported.
PscConfigs []PscConfigResponse `pulumi:"pscConfigs"`
// PSC connections for discovery of the cluster topology and accessing the cluster.
PscConnections []PscConnectionResponse `pulumi:"pscConnections"`
// Optional. The number of replica nodes per shard.
ReplicaCount int `pulumi:"replicaCount"`
// Number of shards for the Redis cluster.
ShardCount int `pulumi:"shardCount"`
// Redis memory size in GB for the entire cluster.
SizeGb int `pulumi:"sizeGb"`
// The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
State string `pulumi:"state"`
// Additional information about the current state of the cluster.
StateInfo StateInfoResponse `pulumi:"stateInfo"`
// Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.
TransitEncryptionMode string `pulumi:"transitEncryptionMode"`
// System assigned, unique identifier for the cluster.
Uid string `pulumi:"uid"`
}
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"`
}
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
}
// Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.
func (o LookupClusterResultOutput) AuthorizationMode() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.AuthorizationMode }).(pulumi.StringOutput)
}
// The timestamp associated with the cluster creation request.
func (o LookupClusterResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one discovery endpoint is supported.
func (o LookupClusterResultOutput) DiscoveryEndpoints() DiscoveryEndpointResponseArrayOutput {
return o.ApplyT(func(v LookupClusterResult) []DiscoveryEndpointResponse { return v.DiscoveryEndpoints }).(DiscoveryEndpointResponseArrayOutput)
}
// Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
func (o LookupClusterResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Name }).(pulumi.StringOutput)
}
// Each PscConfig configures the consumer network where IPs will be designated to the cluster for client access through Private Service Connect Automation. Currently, only one PscConfig is supported.
func (o LookupClusterResultOutput) PscConfigs() PscConfigResponseArrayOutput {
return o.ApplyT(func(v LookupClusterResult) []PscConfigResponse { return v.PscConfigs }).(PscConfigResponseArrayOutput)
}
// PSC connections for discovery of the cluster topology and accessing the cluster.
func (o LookupClusterResultOutput) PscConnections() PscConnectionResponseArrayOutput {
return o.ApplyT(func(v LookupClusterResult) []PscConnectionResponse { return v.PscConnections }).(PscConnectionResponseArrayOutput)
}
// Optional. The number of replica nodes per shard.
func (o LookupClusterResultOutput) ReplicaCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupClusterResult) int { return v.ReplicaCount }).(pulumi.IntOutput)
}
// Number of shards for the Redis cluster.
func (o LookupClusterResultOutput) ShardCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupClusterResult) int { return v.ShardCount }).(pulumi.IntOutput)
}
// Redis memory size in GB for the entire cluster.
func (o LookupClusterResultOutput) SizeGb() pulumi.IntOutput {
return o.ApplyT(func(v LookupClusterResult) int { return v.SizeGb }).(pulumi.IntOutput)
}
// The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
func (o LookupClusterResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.State }).(pulumi.StringOutput)
}
// Additional information about the current state of the cluster.
func (o LookupClusterResultOutput) StateInfo() StateInfoResponseOutput {
return o.ApplyT(func(v LookupClusterResult) StateInfoResponse { return v.StateInfo }).(StateInfoResponseOutput)
}
// Optional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.
func (o LookupClusterResultOutput) TransitEncryptionMode() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.TransitEncryptionMode }).(pulumi.StringOutput)
}
// System assigned, unique identifier for the cluster.
func (o LookupClusterResultOutput) Uid() pulumi.StringOutput {
return o.ApplyT(func(v LookupClusterResult) string { return v.Uid }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupClusterResultOutput{})
}