This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
elasticPool.go
252 lines (228 loc) · 10.2 KB
/
elasticPool.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
// *** 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 v20200202preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// An elastic pool.
type ElasticPool struct {
pulumi.CustomResourceState
// The creation date of the elastic pool (ISO8601 format).
CreationDate pulumi.StringOutput `pulumi:"creationDate"`
// Kind of elastic pool. This is metadata used for the Azure portal experience.
Kind pulumi.StringOutput `pulumi:"kind"`
// The license type to apply for this elastic pool.
LicenseType pulumi.StringPtrOutput `pulumi:"licenseType"`
// Resource location.
Location pulumi.StringOutput `pulumi:"location"`
// The storage limit for the database elastic pool in bytes.
MaxSizeBytes pulumi.Float64PtrOutput `pulumi:"maxSizeBytes"`
// Resource name.
Name pulumi.StringOutput `pulumi:"name"`
// The per database settings for the elastic pool.
PerDatabaseSettings ElasticPoolPerDatabaseSettingsResponsePtrOutput `pulumi:"perDatabaseSettings"`
// The elastic pool SKU.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command:
Sku SkuResponsePtrOutput `pulumi:"sku"`
// The state of the elastic pool.
State pulumi.StringOutput `pulumi:"state"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Resource type.
Type pulumi.StringOutput `pulumi:"type"`
// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
ZoneRedundant pulumi.BoolPtrOutput `pulumi:"zoneRedundant"`
}
// NewElasticPool registers a new resource with the given unique name, arguments, and options.
func NewElasticPool(ctx *pulumi.Context,
name string, args *ElasticPoolArgs, opts ...pulumi.ResourceOption) (*ElasticPool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ElasticPoolName == nil {
return nil, errors.New("invalid value for required argument 'ElasticPoolName'")
}
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:sql/latest:ElasticPool"),
},
{
Type: pulumi.String("azure-nextgen:sql/v20140401:ElasticPool"),
},
{
Type: pulumi.String("azure-nextgen:sql/v20171001preview:ElasticPool"),
},
{
Type: pulumi.String("azure-nextgen:sql/v20200801preview:ElasticPool"),
},
})
opts = append(opts, aliases)
var resource ElasticPool
err := ctx.RegisterResource("azure-nextgen:sql/v20200202preview:ElasticPool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetElasticPool gets an existing ElasticPool 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 GetElasticPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ElasticPoolState, opts ...pulumi.ResourceOption) (*ElasticPool, error) {
var resource ElasticPool
err := ctx.ReadResource("azure-nextgen:sql/v20200202preview:ElasticPool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ElasticPool resources.
type elasticPoolState struct {
// The creation date of the elastic pool (ISO8601 format).
CreationDate *string `pulumi:"creationDate"`
// Kind of elastic pool. This is metadata used for the Azure portal experience.
Kind *string `pulumi:"kind"`
// The license type to apply for this elastic pool.
LicenseType *string `pulumi:"licenseType"`
// Resource location.
Location *string `pulumi:"location"`
// The storage limit for the database elastic pool in bytes.
MaxSizeBytes *float64 `pulumi:"maxSizeBytes"`
// Resource name.
Name *string `pulumi:"name"`
// The per database settings for the elastic pool.
PerDatabaseSettings *ElasticPoolPerDatabaseSettingsResponse `pulumi:"perDatabaseSettings"`
// The elastic pool SKU.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command:
Sku *SkuResponse `pulumi:"sku"`
// The state of the elastic pool.
State *string `pulumi:"state"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Resource type.
Type *string `pulumi:"type"`
// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
ZoneRedundant *bool `pulumi:"zoneRedundant"`
}
type ElasticPoolState struct {
// The creation date of the elastic pool (ISO8601 format).
CreationDate pulumi.StringPtrInput
// Kind of elastic pool. This is metadata used for the Azure portal experience.
Kind pulumi.StringPtrInput
// The license type to apply for this elastic pool.
LicenseType pulumi.StringPtrInput
// Resource location.
Location pulumi.StringPtrInput
// The storage limit for the database elastic pool in bytes.
MaxSizeBytes pulumi.Float64PtrInput
// Resource name.
Name pulumi.StringPtrInput
// The per database settings for the elastic pool.
PerDatabaseSettings ElasticPoolPerDatabaseSettingsResponsePtrInput
// The elastic pool SKU.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command:
Sku SkuResponsePtrInput
// The state of the elastic pool.
State pulumi.StringPtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Resource type.
Type pulumi.StringPtrInput
// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
ZoneRedundant pulumi.BoolPtrInput
}
func (ElasticPoolState) ElementType() reflect.Type {
return reflect.TypeOf((*elasticPoolState)(nil)).Elem()
}
type elasticPoolArgs struct {
// The name of the elastic pool.
ElasticPoolName string `pulumi:"elasticPoolName"`
// The license type to apply for this elastic pool.
LicenseType *string `pulumi:"licenseType"`
// Resource location.
Location *string `pulumi:"location"`
// The storage limit for the database elastic pool in bytes.
MaxSizeBytes *float64 `pulumi:"maxSizeBytes"`
// The per database settings for the elastic pool.
PerDatabaseSettings *ElasticPoolPerDatabaseSettings `pulumi:"perDatabaseSettings"`
// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the server.
ServerName string `pulumi:"serverName"`
// The elastic pool SKU.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command:
Sku *Sku `pulumi:"sku"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
ZoneRedundant *bool `pulumi:"zoneRedundant"`
}
// The set of arguments for constructing a ElasticPool resource.
type ElasticPoolArgs struct {
// The name of the elastic pool.
ElasticPoolName pulumi.StringInput
// The license type to apply for this elastic pool.
LicenseType pulumi.StringPtrInput
// Resource location.
Location pulumi.StringPtrInput
// The storage limit for the database elastic pool in bytes.
MaxSizeBytes pulumi.Float64PtrInput
// The per database settings for the elastic pool.
PerDatabaseSettings ElasticPoolPerDatabaseSettingsPtrInput
// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
ResourceGroupName pulumi.StringInput
// The name of the server.
ServerName pulumi.StringInput
// The elastic pool SKU.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command:
Sku SkuPtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
ZoneRedundant pulumi.BoolPtrInput
}
func (ElasticPoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*elasticPoolArgs)(nil)).Elem()
}
type ElasticPoolInput interface {
pulumi.Input
ToElasticPoolOutput() ElasticPoolOutput
ToElasticPoolOutputWithContext(ctx context.Context) ElasticPoolOutput
}
func (*ElasticPool) ElementType() reflect.Type {
return reflect.TypeOf((*ElasticPool)(nil))
}
func (i *ElasticPool) ToElasticPoolOutput() ElasticPoolOutput {
return i.ToElasticPoolOutputWithContext(context.Background())
}
func (i *ElasticPool) ToElasticPoolOutputWithContext(ctx context.Context) ElasticPoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(ElasticPoolOutput)
}
type ElasticPoolOutput struct {
*pulumi.OutputState
}
func (ElasticPoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ElasticPool)(nil))
}
func (o ElasticPoolOutput) ToElasticPoolOutput() ElasticPoolOutput {
return o
}
func (o ElasticPoolOutput) ToElasticPoolOutputWithContext(ctx context.Context) ElasticPoolOutput {
return o
}
func init() {
pulumi.RegisterOutputType(ElasticPoolOutput{})
}