This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
server.go
279 lines (255 loc) · 11.3 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
277
278
279
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package latest
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Represents a server.
// Latest API Version: 2017-12-01.
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"`
// Status showing whether the server data encryption is enabled with customer-managed keys.
ByokEnforcement pulumi.StringOutput `pulumi:"byokEnforcement"`
// 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 Azure Active Directory identity of the server.
Identity ResourceIdentityResponsePtrOutput `pulumi:"identity"`
// Status showing whether the server enabled infrastructure encryption.
InfrastructureEncryption pulumi.StringPtrOutput `pulumi:"infrastructureEncryption"`
// 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'")
}
if args.ServerName == nil {
return nil, errors.New("invalid value for required argument 'ServerName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:dbforpostgresql/v20171201:Server"),
},
{
Type: pulumi.String("azure-nextgen:dbforpostgresql/v20171201preview:Server"),
},
})
opts = append(opts, aliases)
var resource Server
err := ctx.RegisterResource("azure-nextgen:dbforpostgresql/latest: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-nextgen:dbforpostgresql/latest: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 {
// The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
AdministratorLogin *string `pulumi:"administratorLogin"`
// Status showing whether the server data encryption is enabled with customer-managed keys.
ByokEnforcement *string `pulumi:"byokEnforcement"`
// Earliest restore point creation time (ISO8601 format)
EarliestRestoreDate *string `pulumi:"earliestRestoreDate"`
// The fully qualified domain name of a server.
FullyQualifiedDomainName *string `pulumi:"fullyQualifiedDomainName"`
// The Azure Active Directory identity of the server.
Identity *ResourceIdentityResponse `pulumi:"identity"`
// Status showing whether the server enabled infrastructure encryption.
InfrastructureEncryption *string `pulumi:"infrastructureEncryption"`
// The geo-location where the resource lives
Location *string `pulumi:"location"`
// The master server id of a replica server.
MasterServerId *string `pulumi:"masterServerId"`
// Enforce a minimal Tls version for the server.
MinimalTlsVersion *string `pulumi:"minimalTlsVersion"`
// The name of the resource
Name *string `pulumi:"name"`
// List of private endpoint connections on a server
PrivateEndpointConnections []ServerPrivateEndpointConnectionResponse `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 *string `pulumi:"publicNetworkAccess"`
// The maximum number of replicas that a master server can have.
ReplicaCapacity *int `pulumi:"replicaCapacity"`
// The replication role of the server.
ReplicationRole *string `pulumi:"replicationRole"`
// The SKU (pricing tier) of the server.
Sku *SkuResponse `pulumi:"sku"`
// Enable ssl enforcement or not when connect to server.
SslEnforcement *string `pulumi:"sslEnforcement"`
// Storage profile of a server.
StorageProfile *StorageProfileResponse `pulumi:"storageProfile"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string `pulumi:"type"`
// A state of a server that is visible to user.
UserVisibleState *string `pulumi:"userVisibleState"`
// Server version.
Version *string `pulumi:"version"`
}
type ServerState struct {
// 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.StringPtrInput
// Status showing whether the server data encryption is enabled with customer-managed keys.
ByokEnforcement pulumi.StringPtrInput
// Earliest restore point creation time (ISO8601 format)
EarliestRestoreDate pulumi.StringPtrInput
// The fully qualified domain name of a server.
FullyQualifiedDomainName pulumi.StringPtrInput
// The Azure Active Directory identity of the server.
Identity ResourceIdentityResponsePtrInput
// Status showing whether the server enabled infrastructure encryption.
InfrastructureEncryption pulumi.StringPtrInput
// The geo-location where the resource lives
Location pulumi.StringPtrInput
// The master server id of a replica server.
MasterServerId pulumi.StringPtrInput
// Enforce a minimal Tls version for the server.
MinimalTlsVersion pulumi.StringPtrInput
// The name of the resource
Name pulumi.StringPtrInput
// List of private endpoint connections on a server
PrivateEndpointConnections ServerPrivateEndpointConnectionResponseArrayInput
// 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.StringPtrInput
// The maximum number of replicas that a master server can have.
ReplicaCapacity pulumi.IntPtrInput
// The replication role of the server.
ReplicationRole pulumi.StringPtrInput
// The SKU (pricing tier) of the server.
Sku SkuResponsePtrInput
// Enable ssl enforcement or not when connect to server.
SslEnforcement pulumi.StringPtrInput
// Storage profile of a server.
StorageProfile StorageProfileResponsePtrInput
// Resource tags.
Tags pulumi.StringMapInput
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type pulumi.StringPtrInput
// A state of a server that is visible to user.
UserVisibleState pulumi.StringPtrInput
// Server version.
Version pulumi.StringPtrInput
}
func (ServerState) ElementType() reflect.Type {
return reflect.TypeOf((*serverState)(nil)).Elem()
}
type serverArgs struct {
// The Azure Active Directory identity of the server.
Identity *ResourceIdentity `pulumi:"identity"`
// 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 Azure Active Directory identity of the server.
Identity ResourceIdentityPtrInput
// 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.StringInput
// 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))
}
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))
}
func (o ServerOutput) ToServerOutput() ServerOutput {
return o
}
func (o ServerOutput) ToServerOutputWithContext(ctx context.Context) ServerOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ServerOutput{})
}