-
Notifications
You must be signed in to change notification settings - Fork 51
/
configuration.go
259 lines (213 loc) · 10.6 KB
/
configuration.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package mariadb
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Sets a MariaDB Configuration value on a MariaDB Server.
//
// ## Import
//
// MariaDB Configurations can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:mariadb/configuration:Configuration interactive_timeout /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMariaDB/servers/server1/configurations/interactive_timeout
// ```
type Configuration struct {
pulumi.CustomResourceState
// Specifies the name of the MariaDB Configuration, which needs [to be a valid MariaDB configuration name](https://mariadb.com/kb/en/library/server-system-variables/). Changing this forces a new resource to be created.
Name pulumi.StringOutput `pulumi:"name"`
// The name of the resource group in which the MariaDB Server exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringOutput `pulumi:"resourceGroupName"`
// Specifies the name of the MariaDB Server. Changing this forces a new resource to be created.
ServerName pulumi.StringOutput `pulumi:"serverName"`
// Specifies the value of the MariaDB Configuration. See the MariaDB documentation for valid values.
Value pulumi.StringOutput `pulumi:"value"`
}
// NewConfiguration registers a new resource with the given unique name, arguments, and options.
func NewConfiguration(ctx *pulumi.Context,
name string, args *ConfigurationArgs, opts ...pulumi.ResourceOption) (*Configuration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Name == nil {
return nil, errors.New("invalid value for required argument 'Name'")
}
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'")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
var resource Configuration
err := ctx.RegisterResource("azure:mariadb/configuration:Configuration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetConfiguration gets an existing Configuration 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 GetConfiguration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ConfigurationState, opts ...pulumi.ResourceOption) (*Configuration, error) {
var resource Configuration
err := ctx.ReadResource("azure:mariadb/configuration:Configuration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Configuration resources.
type configurationState struct {
// Specifies the name of the MariaDB Configuration, which needs [to be a valid MariaDB configuration name](https://mariadb.com/kb/en/library/server-system-variables/). Changing this forces a new resource to be created.
Name *string `pulumi:"name"`
// The name of the resource group in which the MariaDB Server exists. Changing this forces a new resource to be created.
ResourceGroupName *string `pulumi:"resourceGroupName"`
// Specifies the name of the MariaDB Server. Changing this forces a new resource to be created.
ServerName *string `pulumi:"serverName"`
// Specifies the value of the MariaDB Configuration. See the MariaDB documentation for valid values.
Value *string `pulumi:"value"`
}
type ConfigurationState struct {
// Specifies the name of the MariaDB Configuration, which needs [to be a valid MariaDB configuration name](https://mariadb.com/kb/en/library/server-system-variables/). Changing this forces a new resource to be created.
Name pulumi.StringPtrInput
// The name of the resource group in which the MariaDB Server exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringPtrInput
// Specifies the name of the MariaDB Server. Changing this forces a new resource to be created.
ServerName pulumi.StringPtrInput
// Specifies the value of the MariaDB Configuration. See the MariaDB documentation for valid values.
Value pulumi.StringPtrInput
}
func (ConfigurationState) ElementType() reflect.Type {
return reflect.TypeOf((*configurationState)(nil)).Elem()
}
type configurationArgs struct {
// Specifies the name of the MariaDB Configuration, which needs [to be a valid MariaDB configuration name](https://mariadb.com/kb/en/library/server-system-variables/). Changing this forces a new resource to be created.
Name string `pulumi:"name"`
// The name of the resource group in which the MariaDB Server exists. Changing this forces a new resource to be created.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Specifies the name of the MariaDB Server. Changing this forces a new resource to be created.
ServerName string `pulumi:"serverName"`
// Specifies the value of the MariaDB Configuration. See the MariaDB documentation for valid values.
Value string `pulumi:"value"`
}
// The set of arguments for constructing a Configuration resource.
type ConfigurationArgs struct {
// Specifies the name of the MariaDB Configuration, which needs [to be a valid MariaDB configuration name](https://mariadb.com/kb/en/library/server-system-variables/). Changing this forces a new resource to be created.
Name pulumi.StringInput
// The name of the resource group in which the MariaDB Server exists. Changing this forces a new resource to be created.
ResourceGroupName pulumi.StringInput
// Specifies the name of the MariaDB Server. Changing this forces a new resource to be created.
ServerName pulumi.StringInput
// Specifies the value of the MariaDB Configuration. See the MariaDB documentation for valid values.
Value pulumi.StringInput
}
func (ConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*configurationArgs)(nil)).Elem()
}
type ConfigurationInput interface {
pulumi.Input
ToConfigurationOutput() ConfigurationOutput
ToConfigurationOutputWithContext(ctx context.Context) ConfigurationOutput
}
func (*Configuration) ElementType() reflect.Type {
return reflect.TypeOf((**Configuration)(nil)).Elem()
}
func (i *Configuration) ToConfigurationOutput() ConfigurationOutput {
return i.ToConfigurationOutputWithContext(context.Background())
}
func (i *Configuration) ToConfigurationOutputWithContext(ctx context.Context) ConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConfigurationOutput)
}
// ConfigurationArrayInput is an input type that accepts ConfigurationArray and ConfigurationArrayOutput values.
// You can construct a concrete instance of `ConfigurationArrayInput` via:
//
// ConfigurationArray{ ConfigurationArgs{...} }
type ConfigurationArrayInput interface {
pulumi.Input
ToConfigurationArrayOutput() ConfigurationArrayOutput
ToConfigurationArrayOutputWithContext(context.Context) ConfigurationArrayOutput
}
type ConfigurationArray []ConfigurationInput
func (ConfigurationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Configuration)(nil)).Elem()
}
func (i ConfigurationArray) ToConfigurationArrayOutput() ConfigurationArrayOutput {
return i.ToConfigurationArrayOutputWithContext(context.Background())
}
func (i ConfigurationArray) ToConfigurationArrayOutputWithContext(ctx context.Context) ConfigurationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConfigurationArrayOutput)
}
// ConfigurationMapInput is an input type that accepts ConfigurationMap and ConfigurationMapOutput values.
// You can construct a concrete instance of `ConfigurationMapInput` via:
//
// ConfigurationMap{ "key": ConfigurationArgs{...} }
type ConfigurationMapInput interface {
pulumi.Input
ToConfigurationMapOutput() ConfigurationMapOutput
ToConfigurationMapOutputWithContext(context.Context) ConfigurationMapOutput
}
type ConfigurationMap map[string]ConfigurationInput
func (ConfigurationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Configuration)(nil)).Elem()
}
func (i ConfigurationMap) ToConfigurationMapOutput() ConfigurationMapOutput {
return i.ToConfigurationMapOutputWithContext(context.Background())
}
func (i ConfigurationMap) ToConfigurationMapOutputWithContext(ctx context.Context) ConfigurationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConfigurationMapOutput)
}
type ConfigurationOutput struct{ *pulumi.OutputState }
func (ConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Configuration)(nil)).Elem()
}
func (o ConfigurationOutput) ToConfigurationOutput() ConfigurationOutput {
return o
}
func (o ConfigurationOutput) ToConfigurationOutputWithContext(ctx context.Context) ConfigurationOutput {
return o
}
type ConfigurationArrayOutput struct{ *pulumi.OutputState }
func (ConfigurationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Configuration)(nil)).Elem()
}
func (o ConfigurationArrayOutput) ToConfigurationArrayOutput() ConfigurationArrayOutput {
return o
}
func (o ConfigurationArrayOutput) ToConfigurationArrayOutputWithContext(ctx context.Context) ConfigurationArrayOutput {
return o
}
func (o ConfigurationArrayOutput) Index(i pulumi.IntInput) ConfigurationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Configuration {
return vs[0].([]*Configuration)[vs[1].(int)]
}).(ConfigurationOutput)
}
type ConfigurationMapOutput struct{ *pulumi.OutputState }
func (ConfigurationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Configuration)(nil)).Elem()
}
func (o ConfigurationMapOutput) ToConfigurationMapOutput() ConfigurationMapOutput {
return o
}
func (o ConfigurationMapOutput) ToConfigurationMapOutputWithContext(ctx context.Context) ConfigurationMapOutput {
return o
}
func (o ConfigurationMapOutput) MapIndex(k pulumi.StringInput) ConfigurationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Configuration {
return vs[0].(map[string]*Configuration)[vs[1].(string)]
}).(ConfigurationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationInput)(nil)).Elem(), &Configuration{})
pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationArrayInput)(nil)).Elem(), ConfigurationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationMapInput)(nil)).Elem(), ConfigurationMap{})
pulumi.RegisterOutputType(ConfigurationOutput{})
pulumi.RegisterOutputType(ConfigurationArrayOutput{})
pulumi.RegisterOutputType(ConfigurationMapOutput{})
}