/
workerConfiguration.go
278 lines (232 loc) · 10.7 KB
/
workerConfiguration.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
// *** 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 mskconnect
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an Amazon MSK Connect Worker Configuration Resource.
//
// ## Example Usage
// ### Basic configuration
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/mskconnect"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := mskconnect.NewWorkerConfiguration(ctx, "example", &mskconnect.WorkerConfigurationArgs{
// PropertiesFileContent: pulumi.String(fmt.Sprintf("%v%v%v", "key.converter=org.apache.kafka.connect.storage.StringConverter\n", "value.converter=org.apache.kafka.connect.storage.StringConverter\n", "\n")),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// MSK Connect Worker Configuration can be imported using the plugin's `arn`, e.g.,
//
// ```sh
// $ pulumi import aws:mskconnect/workerConfiguration:WorkerConfiguration example 'arn:aws:kafkaconnect:eu-central-1:123456789012:worker-configuration/example/8848493b-7fcc-478c-a646-4a52634e3378-4'
// ```
type WorkerConfiguration struct {
pulumi.CustomResourceState
// the Amazon Resource Name (ARN) of the worker configuration.
Arn pulumi.StringOutput `pulumi:"arn"`
// A summary description of the worker configuration.
Description pulumi.StringPtrOutput `pulumi:"description"`
// an ID of the latest successfully created revision of the worker configuration.
LatestRevision pulumi.IntOutput `pulumi:"latestRevision"`
// The name of the worker configuration.
Name pulumi.StringOutput `pulumi:"name"`
// Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format.
PropertiesFileContent pulumi.StringOutput `pulumi:"propertiesFileContent"`
}
// NewWorkerConfiguration registers a new resource with the given unique name, arguments, and options.
func NewWorkerConfiguration(ctx *pulumi.Context,
name string, args *WorkerConfigurationArgs, opts ...pulumi.ResourceOption) (*WorkerConfiguration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PropertiesFileContent == nil {
return nil, errors.New("invalid value for required argument 'PropertiesFileContent'")
}
var resource WorkerConfiguration
err := ctx.RegisterResource("aws:mskconnect/workerConfiguration:WorkerConfiguration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetWorkerConfiguration gets an existing WorkerConfiguration 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 GetWorkerConfiguration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *WorkerConfigurationState, opts ...pulumi.ResourceOption) (*WorkerConfiguration, error) {
var resource WorkerConfiguration
err := ctx.ReadResource("aws:mskconnect/workerConfiguration:WorkerConfiguration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering WorkerConfiguration resources.
type workerConfigurationState struct {
// the Amazon Resource Name (ARN) of the worker configuration.
Arn *string `pulumi:"arn"`
// A summary description of the worker configuration.
Description *string `pulumi:"description"`
// an ID of the latest successfully created revision of the worker configuration.
LatestRevision *int `pulumi:"latestRevision"`
// The name of the worker configuration.
Name *string `pulumi:"name"`
// Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format.
PropertiesFileContent *string `pulumi:"propertiesFileContent"`
}
type WorkerConfigurationState struct {
// the Amazon Resource Name (ARN) of the worker configuration.
Arn pulumi.StringPtrInput
// A summary description of the worker configuration.
Description pulumi.StringPtrInput
// an ID of the latest successfully created revision of the worker configuration.
LatestRevision pulumi.IntPtrInput
// The name of the worker configuration.
Name pulumi.StringPtrInput
// Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format.
PropertiesFileContent pulumi.StringPtrInput
}
func (WorkerConfigurationState) ElementType() reflect.Type {
return reflect.TypeOf((*workerConfigurationState)(nil)).Elem()
}
type workerConfigurationArgs struct {
// A summary description of the worker configuration.
Description *string `pulumi:"description"`
// The name of the worker configuration.
Name *string `pulumi:"name"`
// Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format.
PropertiesFileContent string `pulumi:"propertiesFileContent"`
}
// The set of arguments for constructing a WorkerConfiguration resource.
type WorkerConfigurationArgs struct {
// A summary description of the worker configuration.
Description pulumi.StringPtrInput
// The name of the worker configuration.
Name pulumi.StringPtrInput
// Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format.
PropertiesFileContent pulumi.StringInput
}
func (WorkerConfigurationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*workerConfigurationArgs)(nil)).Elem()
}
type WorkerConfigurationInput interface {
pulumi.Input
ToWorkerConfigurationOutput() WorkerConfigurationOutput
ToWorkerConfigurationOutputWithContext(ctx context.Context) WorkerConfigurationOutput
}
func (*WorkerConfiguration) ElementType() reflect.Type {
return reflect.TypeOf((**WorkerConfiguration)(nil)).Elem()
}
func (i *WorkerConfiguration) ToWorkerConfigurationOutput() WorkerConfigurationOutput {
return i.ToWorkerConfigurationOutputWithContext(context.Background())
}
func (i *WorkerConfiguration) ToWorkerConfigurationOutputWithContext(ctx context.Context) WorkerConfigurationOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkerConfigurationOutput)
}
// WorkerConfigurationArrayInput is an input type that accepts WorkerConfigurationArray and WorkerConfigurationArrayOutput values.
// You can construct a concrete instance of `WorkerConfigurationArrayInput` via:
//
// WorkerConfigurationArray{ WorkerConfigurationArgs{...} }
type WorkerConfigurationArrayInput interface {
pulumi.Input
ToWorkerConfigurationArrayOutput() WorkerConfigurationArrayOutput
ToWorkerConfigurationArrayOutputWithContext(context.Context) WorkerConfigurationArrayOutput
}
type WorkerConfigurationArray []WorkerConfigurationInput
func (WorkerConfigurationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*WorkerConfiguration)(nil)).Elem()
}
func (i WorkerConfigurationArray) ToWorkerConfigurationArrayOutput() WorkerConfigurationArrayOutput {
return i.ToWorkerConfigurationArrayOutputWithContext(context.Background())
}
func (i WorkerConfigurationArray) ToWorkerConfigurationArrayOutputWithContext(ctx context.Context) WorkerConfigurationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkerConfigurationArrayOutput)
}
// WorkerConfigurationMapInput is an input type that accepts WorkerConfigurationMap and WorkerConfigurationMapOutput values.
// You can construct a concrete instance of `WorkerConfigurationMapInput` via:
//
// WorkerConfigurationMap{ "key": WorkerConfigurationArgs{...} }
type WorkerConfigurationMapInput interface {
pulumi.Input
ToWorkerConfigurationMapOutput() WorkerConfigurationMapOutput
ToWorkerConfigurationMapOutputWithContext(context.Context) WorkerConfigurationMapOutput
}
type WorkerConfigurationMap map[string]WorkerConfigurationInput
func (WorkerConfigurationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*WorkerConfiguration)(nil)).Elem()
}
func (i WorkerConfigurationMap) ToWorkerConfigurationMapOutput() WorkerConfigurationMapOutput {
return i.ToWorkerConfigurationMapOutputWithContext(context.Background())
}
func (i WorkerConfigurationMap) ToWorkerConfigurationMapOutputWithContext(ctx context.Context) WorkerConfigurationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(WorkerConfigurationMapOutput)
}
type WorkerConfigurationOutput struct{ *pulumi.OutputState }
func (WorkerConfigurationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**WorkerConfiguration)(nil)).Elem()
}
func (o WorkerConfigurationOutput) ToWorkerConfigurationOutput() WorkerConfigurationOutput {
return o
}
func (o WorkerConfigurationOutput) ToWorkerConfigurationOutputWithContext(ctx context.Context) WorkerConfigurationOutput {
return o
}
type WorkerConfigurationArrayOutput struct{ *pulumi.OutputState }
func (WorkerConfigurationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*WorkerConfiguration)(nil)).Elem()
}
func (o WorkerConfigurationArrayOutput) ToWorkerConfigurationArrayOutput() WorkerConfigurationArrayOutput {
return o
}
func (o WorkerConfigurationArrayOutput) ToWorkerConfigurationArrayOutputWithContext(ctx context.Context) WorkerConfigurationArrayOutput {
return o
}
func (o WorkerConfigurationArrayOutput) Index(i pulumi.IntInput) WorkerConfigurationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *WorkerConfiguration {
return vs[0].([]*WorkerConfiguration)[vs[1].(int)]
}).(WorkerConfigurationOutput)
}
type WorkerConfigurationMapOutput struct{ *pulumi.OutputState }
func (WorkerConfigurationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*WorkerConfiguration)(nil)).Elem()
}
func (o WorkerConfigurationMapOutput) ToWorkerConfigurationMapOutput() WorkerConfigurationMapOutput {
return o
}
func (o WorkerConfigurationMapOutput) ToWorkerConfigurationMapOutputWithContext(ctx context.Context) WorkerConfigurationMapOutput {
return o
}
func (o WorkerConfigurationMapOutput) MapIndex(k pulumi.StringInput) WorkerConfigurationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *WorkerConfiguration {
return vs[0].(map[string]*WorkerConfiguration)[vs[1].(string)]
}).(WorkerConfigurationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*WorkerConfigurationInput)(nil)).Elem(), &WorkerConfiguration{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkerConfigurationArrayInput)(nil)).Elem(), WorkerConfigurationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*WorkerConfigurationMapInput)(nil)).Elem(), WorkerConfigurationMap{})
pulumi.RegisterOutputType(WorkerConfigurationOutput{})
pulumi.RegisterOutputType(WorkerConfigurationArrayOutput{})
pulumi.RegisterOutputType(WorkerConfigurationMapOutput{})
}