github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/mskconnect/workerConfiguration.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package mskconnect 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides an Amazon MSK Connect Worker Configuration Resource. 16 // 17 // ## Example Usage 18 // 19 // ### Basic configuration 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/mskconnect" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := mskconnect.NewWorkerConfiguration(ctx, "example", &mskconnect.WorkerConfigurationArgs{ 35 // Name: pulumi.String("example"), 36 // PropertiesFileContent: pulumi.String("key.converter=org.apache.kafka.connect.storage.StringConverter\nvalue.converter=org.apache.kafka.connect.storage.StringConverter\n"), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import MSK Connect Worker Configuration using the plugin's `arn`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:mskconnect/workerConfiguration:WorkerConfiguration example 'arn:aws:kafkaconnect:eu-central-1:123456789012:worker-configuration/example/8848493b-7fcc-478c-a646-4a52634e3378-4' 54 // ``` 55 type WorkerConfiguration struct { 56 pulumi.CustomResourceState 57 58 // the Amazon Resource Name (ARN) of the worker configuration. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // A summary description of the worker configuration. 61 Description pulumi.StringPtrOutput `pulumi:"description"` 62 // an ID of the latest successfully created revision of the worker configuration. 63 LatestRevision pulumi.IntOutput `pulumi:"latestRevision"` 64 // The name of the worker configuration. 65 Name pulumi.StringOutput `pulumi:"name"` 66 // Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format. 67 // 68 // The following arguments are optional: 69 PropertiesFileContent pulumi.StringOutput `pulumi:"propertiesFileContent"` 70 } 71 72 // NewWorkerConfiguration registers a new resource with the given unique name, arguments, and options. 73 func NewWorkerConfiguration(ctx *pulumi.Context, 74 name string, args *WorkerConfigurationArgs, opts ...pulumi.ResourceOption) (*WorkerConfiguration, error) { 75 if args == nil { 76 return nil, errors.New("missing one or more required arguments") 77 } 78 79 if args.PropertiesFileContent == nil { 80 return nil, errors.New("invalid value for required argument 'PropertiesFileContent'") 81 } 82 opts = internal.PkgResourceDefaultOpts(opts) 83 var resource WorkerConfiguration 84 err := ctx.RegisterResource("aws:mskconnect/workerConfiguration:WorkerConfiguration", name, args, &resource, opts...) 85 if err != nil { 86 return nil, err 87 } 88 return &resource, nil 89 } 90 91 // GetWorkerConfiguration gets an existing WorkerConfiguration resource's state with the given name, ID, and optional 92 // state properties that are used to uniquely qualify the lookup (nil if not required). 93 func GetWorkerConfiguration(ctx *pulumi.Context, 94 name string, id pulumi.IDInput, state *WorkerConfigurationState, opts ...pulumi.ResourceOption) (*WorkerConfiguration, error) { 95 var resource WorkerConfiguration 96 err := ctx.ReadResource("aws:mskconnect/workerConfiguration:WorkerConfiguration", name, id, state, &resource, opts...) 97 if err != nil { 98 return nil, err 99 } 100 return &resource, nil 101 } 102 103 // Input properties used for looking up and filtering WorkerConfiguration resources. 104 type workerConfigurationState struct { 105 // the Amazon Resource Name (ARN) of the worker configuration. 106 Arn *string `pulumi:"arn"` 107 // A summary description of the worker configuration. 108 Description *string `pulumi:"description"` 109 // an ID of the latest successfully created revision of the worker configuration. 110 LatestRevision *int `pulumi:"latestRevision"` 111 // The name of the worker configuration. 112 Name *string `pulumi:"name"` 113 // Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format. 114 // 115 // The following arguments are optional: 116 PropertiesFileContent *string `pulumi:"propertiesFileContent"` 117 } 118 119 type WorkerConfigurationState struct { 120 // the Amazon Resource Name (ARN) of the worker configuration. 121 Arn pulumi.StringPtrInput 122 // A summary description of the worker configuration. 123 Description pulumi.StringPtrInput 124 // an ID of the latest successfully created revision of the worker configuration. 125 LatestRevision pulumi.IntPtrInput 126 // The name of the worker configuration. 127 Name pulumi.StringPtrInput 128 // Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format. 129 // 130 // The following arguments are optional: 131 PropertiesFileContent pulumi.StringPtrInput 132 } 133 134 func (WorkerConfigurationState) ElementType() reflect.Type { 135 return reflect.TypeOf((*workerConfigurationState)(nil)).Elem() 136 } 137 138 type workerConfigurationArgs struct { 139 // A summary description of the worker configuration. 140 Description *string `pulumi:"description"` 141 // The name of the worker configuration. 142 Name *string `pulumi:"name"` 143 // Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format. 144 // 145 // The following arguments are optional: 146 PropertiesFileContent string `pulumi:"propertiesFileContent"` 147 } 148 149 // The set of arguments for constructing a WorkerConfiguration resource. 150 type WorkerConfigurationArgs struct { 151 // A summary description of the worker configuration. 152 Description pulumi.StringPtrInput 153 // The name of the worker configuration. 154 Name pulumi.StringPtrInput 155 // Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format. 156 // 157 // The following arguments are optional: 158 PropertiesFileContent pulumi.StringInput 159 } 160 161 func (WorkerConfigurationArgs) ElementType() reflect.Type { 162 return reflect.TypeOf((*workerConfigurationArgs)(nil)).Elem() 163 } 164 165 type WorkerConfigurationInput interface { 166 pulumi.Input 167 168 ToWorkerConfigurationOutput() WorkerConfigurationOutput 169 ToWorkerConfigurationOutputWithContext(ctx context.Context) WorkerConfigurationOutput 170 } 171 172 func (*WorkerConfiguration) ElementType() reflect.Type { 173 return reflect.TypeOf((**WorkerConfiguration)(nil)).Elem() 174 } 175 176 func (i *WorkerConfiguration) ToWorkerConfigurationOutput() WorkerConfigurationOutput { 177 return i.ToWorkerConfigurationOutputWithContext(context.Background()) 178 } 179 180 func (i *WorkerConfiguration) ToWorkerConfigurationOutputWithContext(ctx context.Context) WorkerConfigurationOutput { 181 return pulumi.ToOutputWithContext(ctx, i).(WorkerConfigurationOutput) 182 } 183 184 // WorkerConfigurationArrayInput is an input type that accepts WorkerConfigurationArray and WorkerConfigurationArrayOutput values. 185 // You can construct a concrete instance of `WorkerConfigurationArrayInput` via: 186 // 187 // WorkerConfigurationArray{ WorkerConfigurationArgs{...} } 188 type WorkerConfigurationArrayInput interface { 189 pulumi.Input 190 191 ToWorkerConfigurationArrayOutput() WorkerConfigurationArrayOutput 192 ToWorkerConfigurationArrayOutputWithContext(context.Context) WorkerConfigurationArrayOutput 193 } 194 195 type WorkerConfigurationArray []WorkerConfigurationInput 196 197 func (WorkerConfigurationArray) ElementType() reflect.Type { 198 return reflect.TypeOf((*[]*WorkerConfiguration)(nil)).Elem() 199 } 200 201 func (i WorkerConfigurationArray) ToWorkerConfigurationArrayOutput() WorkerConfigurationArrayOutput { 202 return i.ToWorkerConfigurationArrayOutputWithContext(context.Background()) 203 } 204 205 func (i WorkerConfigurationArray) ToWorkerConfigurationArrayOutputWithContext(ctx context.Context) WorkerConfigurationArrayOutput { 206 return pulumi.ToOutputWithContext(ctx, i).(WorkerConfigurationArrayOutput) 207 } 208 209 // WorkerConfigurationMapInput is an input type that accepts WorkerConfigurationMap and WorkerConfigurationMapOutput values. 210 // You can construct a concrete instance of `WorkerConfigurationMapInput` via: 211 // 212 // WorkerConfigurationMap{ "key": WorkerConfigurationArgs{...} } 213 type WorkerConfigurationMapInput interface { 214 pulumi.Input 215 216 ToWorkerConfigurationMapOutput() WorkerConfigurationMapOutput 217 ToWorkerConfigurationMapOutputWithContext(context.Context) WorkerConfigurationMapOutput 218 } 219 220 type WorkerConfigurationMap map[string]WorkerConfigurationInput 221 222 func (WorkerConfigurationMap) ElementType() reflect.Type { 223 return reflect.TypeOf((*map[string]*WorkerConfiguration)(nil)).Elem() 224 } 225 226 func (i WorkerConfigurationMap) ToWorkerConfigurationMapOutput() WorkerConfigurationMapOutput { 227 return i.ToWorkerConfigurationMapOutputWithContext(context.Background()) 228 } 229 230 func (i WorkerConfigurationMap) ToWorkerConfigurationMapOutputWithContext(ctx context.Context) WorkerConfigurationMapOutput { 231 return pulumi.ToOutputWithContext(ctx, i).(WorkerConfigurationMapOutput) 232 } 233 234 type WorkerConfigurationOutput struct{ *pulumi.OutputState } 235 236 func (WorkerConfigurationOutput) ElementType() reflect.Type { 237 return reflect.TypeOf((**WorkerConfiguration)(nil)).Elem() 238 } 239 240 func (o WorkerConfigurationOutput) ToWorkerConfigurationOutput() WorkerConfigurationOutput { 241 return o 242 } 243 244 func (o WorkerConfigurationOutput) ToWorkerConfigurationOutputWithContext(ctx context.Context) WorkerConfigurationOutput { 245 return o 246 } 247 248 // the Amazon Resource Name (ARN) of the worker configuration. 249 func (o WorkerConfigurationOutput) Arn() pulumi.StringOutput { 250 return o.ApplyT(func(v *WorkerConfiguration) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 251 } 252 253 // A summary description of the worker configuration. 254 func (o WorkerConfigurationOutput) Description() pulumi.StringPtrOutput { 255 return o.ApplyT(func(v *WorkerConfiguration) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 256 } 257 258 // an ID of the latest successfully created revision of the worker configuration. 259 func (o WorkerConfigurationOutput) LatestRevision() pulumi.IntOutput { 260 return o.ApplyT(func(v *WorkerConfiguration) pulumi.IntOutput { return v.LatestRevision }).(pulumi.IntOutput) 261 } 262 263 // The name of the worker configuration. 264 func (o WorkerConfigurationOutput) Name() pulumi.StringOutput { 265 return o.ApplyT(func(v *WorkerConfiguration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 266 } 267 268 // Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format. 269 // 270 // The following arguments are optional: 271 func (o WorkerConfigurationOutput) PropertiesFileContent() pulumi.StringOutput { 272 return o.ApplyT(func(v *WorkerConfiguration) pulumi.StringOutput { return v.PropertiesFileContent }).(pulumi.StringOutput) 273 } 274 275 type WorkerConfigurationArrayOutput struct{ *pulumi.OutputState } 276 277 func (WorkerConfigurationArrayOutput) ElementType() reflect.Type { 278 return reflect.TypeOf((*[]*WorkerConfiguration)(nil)).Elem() 279 } 280 281 func (o WorkerConfigurationArrayOutput) ToWorkerConfigurationArrayOutput() WorkerConfigurationArrayOutput { 282 return o 283 } 284 285 func (o WorkerConfigurationArrayOutput) ToWorkerConfigurationArrayOutputWithContext(ctx context.Context) WorkerConfigurationArrayOutput { 286 return o 287 } 288 289 func (o WorkerConfigurationArrayOutput) Index(i pulumi.IntInput) WorkerConfigurationOutput { 290 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *WorkerConfiguration { 291 return vs[0].([]*WorkerConfiguration)[vs[1].(int)] 292 }).(WorkerConfigurationOutput) 293 } 294 295 type WorkerConfigurationMapOutput struct{ *pulumi.OutputState } 296 297 func (WorkerConfigurationMapOutput) ElementType() reflect.Type { 298 return reflect.TypeOf((*map[string]*WorkerConfiguration)(nil)).Elem() 299 } 300 301 func (o WorkerConfigurationMapOutput) ToWorkerConfigurationMapOutput() WorkerConfigurationMapOutput { 302 return o 303 } 304 305 func (o WorkerConfigurationMapOutput) ToWorkerConfigurationMapOutputWithContext(ctx context.Context) WorkerConfigurationMapOutput { 306 return o 307 } 308 309 func (o WorkerConfigurationMapOutput) MapIndex(k pulumi.StringInput) WorkerConfigurationOutput { 310 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *WorkerConfiguration { 311 return vs[0].(map[string]*WorkerConfiguration)[vs[1].(string)] 312 }).(WorkerConfigurationOutput) 313 } 314 315 func init() { 316 pulumi.RegisterInputType(reflect.TypeOf((*WorkerConfigurationInput)(nil)).Elem(), &WorkerConfiguration{}) 317 pulumi.RegisterInputType(reflect.TypeOf((*WorkerConfigurationArrayInput)(nil)).Elem(), WorkerConfigurationArray{}) 318 pulumi.RegisterInputType(reflect.TypeOf((*WorkerConfigurationMapInput)(nil)).Elem(), WorkerConfigurationMap{}) 319 pulumi.RegisterOutputType(WorkerConfigurationOutput{}) 320 pulumi.RegisterOutputType(WorkerConfigurationArrayOutput{}) 321 pulumi.RegisterOutputType(WorkerConfigurationMapOutput{}) 322 }