forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.go
276 lines (234 loc) · 10.5 KB
/
server.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
// 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 dbformariadb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Represents a server.
// Azure REST API version: 2018-06-01. Prior API version in Azure Native 1.x: 2018-06-01.
//
// Other available API versions: 2018-06-01-preview.
type Server struct {
pulumi.CustomResourceState
// The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
AdministratorLogin pulumi.StringPtrOutput `pulumi:"administratorLogin"`
// Earliest restore point creation time (ISO8601 format)
EarliestRestoreDate pulumi.StringPtrOutput `pulumi:"earliestRestoreDate"`
// The fully qualified domain name of a server.
FullyQualifiedDomainName pulumi.StringPtrOutput `pulumi:"fullyQualifiedDomainName"`
// The geo-location where the resource lives
Location pulumi.StringOutput `pulumi:"location"`
// The master server id of a replica server.
MasterServerId pulumi.StringPtrOutput `pulumi:"masterServerId"`
// Enforce a minimal Tls version for the server.
MinimalTlsVersion pulumi.StringPtrOutput `pulumi:"minimalTlsVersion"`
// The name of the resource
Name pulumi.StringOutput `pulumi:"name"`
// List of private endpoint connections on a server
PrivateEndpointConnections ServerPrivateEndpointConnectionResponseArrayOutput `pulumi:"privateEndpointConnections"`
// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
PublicNetworkAccess pulumi.StringPtrOutput `pulumi:"publicNetworkAccess"`
// The maximum number of replicas that a master server can have.
ReplicaCapacity pulumi.IntPtrOutput `pulumi:"replicaCapacity"`
// The replication role of the server.
ReplicationRole pulumi.StringPtrOutput `pulumi:"replicationRole"`
// The SKU (pricing tier) of the server.
Sku SkuResponsePtrOutput `pulumi:"sku"`
// Enable ssl enforcement or not when connect to server.
SslEnforcement pulumi.StringPtrOutput `pulumi:"sslEnforcement"`
// Storage profile of a server.
StorageProfile StorageProfileResponsePtrOutput `pulumi:"storageProfile"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type pulumi.StringOutput `pulumi:"type"`
// A state of a server that is visible to user.
UserVisibleState pulumi.StringPtrOutput `pulumi:"userVisibleState"`
// Server version.
Version pulumi.StringPtrOutput `pulumi:"version"`
}
// NewServer registers a new resource with the given unique name, arguments, and options.
func NewServer(ctx *pulumi.Context,
name string, args *ServerArgs, opts ...pulumi.ResourceOption) (*Server, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Properties == nil {
return nil, errors.New("invalid value for required argument 'Properties'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:dbformariadb/v20180601:Server"),
},
{
Type: pulumi.String("azure-native:dbformariadb/v20180601preview:Server"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource Server
err := ctx.RegisterResource("azure-native:dbformariadb:Server", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetServer gets an existing Server resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetServer(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServerState, opts ...pulumi.ResourceOption) (*Server, error) {
var resource Server
err := ctx.ReadResource("azure-native:dbformariadb:Server", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Server resources.
type serverState struct {
}
type ServerState struct {
}
func (ServerState) ElementType() reflect.Type {
return reflect.TypeOf((*serverState)(nil)).Elem()
}
type serverArgs struct {
// The location the resource resides in.
Location *string `pulumi:"location"`
// Properties of the server.
Properties interface{} `pulumi:"properties"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the server.
ServerName *string `pulumi:"serverName"`
// The SKU (pricing tier) of the server.
Sku *Sku `pulumi:"sku"`
// Application-specific metadata in the form of key-value pairs.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Server resource.
type ServerArgs struct {
// The location the resource resides in.
Location pulumi.StringPtrInput
// Properties of the server.
Properties pulumi.Input
// The name of the resource group. The name is case insensitive.
ResourceGroupName pulumi.StringInput
// The name of the server.
ServerName pulumi.StringPtrInput
// The SKU (pricing tier) of the server.
Sku SkuPtrInput
// Application-specific metadata in the form of key-value pairs.
Tags pulumi.StringMapInput
}
func (ServerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serverArgs)(nil)).Elem()
}
type ServerInput interface {
pulumi.Input
ToServerOutput() ServerOutput
ToServerOutputWithContext(ctx context.Context) ServerOutput
}
func (*Server) ElementType() reflect.Type {
return reflect.TypeOf((**Server)(nil)).Elem()
}
func (i *Server) ToServerOutput() ServerOutput {
return i.ToServerOutputWithContext(context.Background())
}
func (i *Server) ToServerOutputWithContext(ctx context.Context) ServerOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServerOutput)
}
type ServerOutput struct{ *pulumi.OutputState }
func (ServerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Server)(nil)).Elem()
}
func (o ServerOutput) ToServerOutput() ServerOutput {
return o
}
func (o ServerOutput) ToServerOutputWithContext(ctx context.Context) ServerOutput {
return o
}
// The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
func (o ServerOutput) AdministratorLogin() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.AdministratorLogin }).(pulumi.StringPtrOutput)
}
// Earliest restore point creation time (ISO8601 format)
func (o ServerOutput) EarliestRestoreDate() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.EarliestRestoreDate }).(pulumi.StringPtrOutput)
}
// The fully qualified domain name of a server.
func (o ServerOutput) FullyQualifiedDomainName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.FullyQualifiedDomainName }).(pulumi.StringPtrOutput)
}
// The geo-location where the resource lives
func (o ServerOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Server) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The master server id of a replica server.
func (o ServerOutput) MasterServerId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.MasterServerId }).(pulumi.StringPtrOutput)
}
// Enforce a minimal Tls version for the server.
func (o ServerOutput) MinimalTlsVersion() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.MinimalTlsVersion }).(pulumi.StringPtrOutput)
}
// The name of the resource
func (o ServerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Server) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// List of private endpoint connections on a server
func (o ServerOutput) PrivateEndpointConnections() ServerPrivateEndpointConnectionResponseArrayOutput {
return o.ApplyT(func(v *Server) ServerPrivateEndpointConnectionResponseArrayOutput {
return v.PrivateEndpointConnections
}).(ServerPrivateEndpointConnectionResponseArrayOutput)
}
// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
func (o ServerOutput) PublicNetworkAccess() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.PublicNetworkAccess }).(pulumi.StringPtrOutput)
}
// The maximum number of replicas that a master server can have.
func (o ServerOutput) ReplicaCapacity() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Server) pulumi.IntPtrOutput { return v.ReplicaCapacity }).(pulumi.IntPtrOutput)
}
// The replication role of the server.
func (o ServerOutput) ReplicationRole() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.ReplicationRole }).(pulumi.StringPtrOutput)
}
// The SKU (pricing tier) of the server.
func (o ServerOutput) Sku() SkuResponsePtrOutput {
return o.ApplyT(func(v *Server) SkuResponsePtrOutput { return v.Sku }).(SkuResponsePtrOutput)
}
// Enable ssl enforcement or not when connect to server.
func (o ServerOutput) SslEnforcement() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.SslEnforcement }).(pulumi.StringPtrOutput)
}
// Storage profile of a server.
func (o ServerOutput) StorageProfile() StorageProfileResponsePtrOutput {
return o.ApplyT(func(v *Server) StorageProfileResponsePtrOutput { return v.StorageProfile }).(StorageProfileResponsePtrOutput)
}
// Resource tags.
func (o ServerOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Server) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
func (o ServerOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Server) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// A state of a server that is visible to user.
func (o ServerOutput) UserVisibleState() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.UserVisibleState }).(pulumi.StringPtrOutput)
}
// Server version.
func (o ServerOutput) Version() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Server) pulumi.StringPtrOutput { return v.Version }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(ServerOutput{})
}