github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/mskconnect/customPlugin.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 Custom Plugin 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-aws/sdk/v6/go/aws/s3" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{ 36 // Bucket: pulumi.String("example"), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // exampleBucketObjectv2, err := s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{ 42 // Bucket: example.ID(), 43 // Key: pulumi.String("debezium.zip"), 44 // Source: pulumi.NewFileAsset("debezium.zip"), 45 // }) 46 // if err != nil { 47 // return err 48 // } 49 // _, err = mskconnect.NewCustomPlugin(ctx, "example", &mskconnect.CustomPluginArgs{ 50 // Name: pulumi.String("debezium-example"), 51 // ContentType: pulumi.String("ZIP"), 52 // Location: &mskconnect.CustomPluginLocationArgs{ 53 // S3: &mskconnect.CustomPluginLocationS3Args{ 54 // BucketArn: example.Arn, 55 // FileKey: exampleBucketObjectv2.Key, 56 // }, 57 // }, 58 // }) 59 // if err != nil { 60 // return err 61 // } 62 // return nil 63 // }) 64 // } 65 // 66 // ``` 67 // <!--End PulumiCodeChooser --> 68 // 69 // ## Import 70 // 71 // Using `pulumi import`, import MSK Connect Custom Plugin using the plugin's `arn`. For example: 72 // 73 // ```sh 74 // $ pulumi import aws:mskconnect/customPlugin:CustomPlugin example 'arn:aws:kafkaconnect:eu-central-1:123456789012:custom-plugin/debezium-example/abcdefgh-1234-5678-9abc-defghijklmno-4' 75 // ``` 76 type CustomPlugin struct { 77 pulumi.CustomResourceState 78 79 // the Amazon Resource Name (ARN) of the custom plugin. 80 Arn pulumi.StringOutput `pulumi:"arn"` 81 // The type of the plugin file. Allowed values are `ZIP` and `JAR`. 82 ContentType pulumi.StringOutput `pulumi:"contentType"` 83 // A summary description of the custom plugin. 84 Description pulumi.StringPtrOutput `pulumi:"description"` 85 // an ID of the latest successfully created revision of the custom plugin. 86 LatestRevision pulumi.IntOutput `pulumi:"latestRevision"` 87 // Information about the location of a custom plugin. See below. 88 // 89 // The following arguments are optional: 90 Location CustomPluginLocationOutput `pulumi:"location"` 91 // The name of the custom plugin.. 92 Name pulumi.StringOutput `pulumi:"name"` 93 // the state of the custom plugin. 94 State pulumi.StringOutput `pulumi:"state"` 95 } 96 97 // NewCustomPlugin registers a new resource with the given unique name, arguments, and options. 98 func NewCustomPlugin(ctx *pulumi.Context, 99 name string, args *CustomPluginArgs, opts ...pulumi.ResourceOption) (*CustomPlugin, error) { 100 if args == nil { 101 return nil, errors.New("missing one or more required arguments") 102 } 103 104 if args.ContentType == nil { 105 return nil, errors.New("invalid value for required argument 'ContentType'") 106 } 107 if args.Location == nil { 108 return nil, errors.New("invalid value for required argument 'Location'") 109 } 110 opts = internal.PkgResourceDefaultOpts(opts) 111 var resource CustomPlugin 112 err := ctx.RegisterResource("aws:mskconnect/customPlugin:CustomPlugin", name, args, &resource, opts...) 113 if err != nil { 114 return nil, err 115 } 116 return &resource, nil 117 } 118 119 // GetCustomPlugin gets an existing CustomPlugin resource's state with the given name, ID, and optional 120 // state properties that are used to uniquely qualify the lookup (nil if not required). 121 func GetCustomPlugin(ctx *pulumi.Context, 122 name string, id pulumi.IDInput, state *CustomPluginState, opts ...pulumi.ResourceOption) (*CustomPlugin, error) { 123 var resource CustomPlugin 124 err := ctx.ReadResource("aws:mskconnect/customPlugin:CustomPlugin", name, id, state, &resource, opts...) 125 if err != nil { 126 return nil, err 127 } 128 return &resource, nil 129 } 130 131 // Input properties used for looking up and filtering CustomPlugin resources. 132 type customPluginState struct { 133 // the Amazon Resource Name (ARN) of the custom plugin. 134 Arn *string `pulumi:"arn"` 135 // The type of the plugin file. Allowed values are `ZIP` and `JAR`. 136 ContentType *string `pulumi:"contentType"` 137 // A summary description of the custom plugin. 138 Description *string `pulumi:"description"` 139 // an ID of the latest successfully created revision of the custom plugin. 140 LatestRevision *int `pulumi:"latestRevision"` 141 // Information about the location of a custom plugin. See below. 142 // 143 // The following arguments are optional: 144 Location *CustomPluginLocation `pulumi:"location"` 145 // The name of the custom plugin.. 146 Name *string `pulumi:"name"` 147 // the state of the custom plugin. 148 State *string `pulumi:"state"` 149 } 150 151 type CustomPluginState struct { 152 // the Amazon Resource Name (ARN) of the custom plugin. 153 Arn pulumi.StringPtrInput 154 // The type of the plugin file. Allowed values are `ZIP` and `JAR`. 155 ContentType pulumi.StringPtrInput 156 // A summary description of the custom plugin. 157 Description pulumi.StringPtrInput 158 // an ID of the latest successfully created revision of the custom plugin. 159 LatestRevision pulumi.IntPtrInput 160 // Information about the location of a custom plugin. See below. 161 // 162 // The following arguments are optional: 163 Location CustomPluginLocationPtrInput 164 // The name of the custom plugin.. 165 Name pulumi.StringPtrInput 166 // the state of the custom plugin. 167 State pulumi.StringPtrInput 168 } 169 170 func (CustomPluginState) ElementType() reflect.Type { 171 return reflect.TypeOf((*customPluginState)(nil)).Elem() 172 } 173 174 type customPluginArgs struct { 175 // The type of the plugin file. Allowed values are `ZIP` and `JAR`. 176 ContentType string `pulumi:"contentType"` 177 // A summary description of the custom plugin. 178 Description *string `pulumi:"description"` 179 // Information about the location of a custom plugin. See below. 180 // 181 // The following arguments are optional: 182 Location CustomPluginLocation `pulumi:"location"` 183 // The name of the custom plugin.. 184 Name *string `pulumi:"name"` 185 } 186 187 // The set of arguments for constructing a CustomPlugin resource. 188 type CustomPluginArgs struct { 189 // The type of the plugin file. Allowed values are `ZIP` and `JAR`. 190 ContentType pulumi.StringInput 191 // A summary description of the custom plugin. 192 Description pulumi.StringPtrInput 193 // Information about the location of a custom plugin. See below. 194 // 195 // The following arguments are optional: 196 Location CustomPluginLocationInput 197 // The name of the custom plugin.. 198 Name pulumi.StringPtrInput 199 } 200 201 func (CustomPluginArgs) ElementType() reflect.Type { 202 return reflect.TypeOf((*customPluginArgs)(nil)).Elem() 203 } 204 205 type CustomPluginInput interface { 206 pulumi.Input 207 208 ToCustomPluginOutput() CustomPluginOutput 209 ToCustomPluginOutputWithContext(ctx context.Context) CustomPluginOutput 210 } 211 212 func (*CustomPlugin) ElementType() reflect.Type { 213 return reflect.TypeOf((**CustomPlugin)(nil)).Elem() 214 } 215 216 func (i *CustomPlugin) ToCustomPluginOutput() CustomPluginOutput { 217 return i.ToCustomPluginOutputWithContext(context.Background()) 218 } 219 220 func (i *CustomPlugin) ToCustomPluginOutputWithContext(ctx context.Context) CustomPluginOutput { 221 return pulumi.ToOutputWithContext(ctx, i).(CustomPluginOutput) 222 } 223 224 // CustomPluginArrayInput is an input type that accepts CustomPluginArray and CustomPluginArrayOutput values. 225 // You can construct a concrete instance of `CustomPluginArrayInput` via: 226 // 227 // CustomPluginArray{ CustomPluginArgs{...} } 228 type CustomPluginArrayInput interface { 229 pulumi.Input 230 231 ToCustomPluginArrayOutput() CustomPluginArrayOutput 232 ToCustomPluginArrayOutputWithContext(context.Context) CustomPluginArrayOutput 233 } 234 235 type CustomPluginArray []CustomPluginInput 236 237 func (CustomPluginArray) ElementType() reflect.Type { 238 return reflect.TypeOf((*[]*CustomPlugin)(nil)).Elem() 239 } 240 241 func (i CustomPluginArray) ToCustomPluginArrayOutput() CustomPluginArrayOutput { 242 return i.ToCustomPluginArrayOutputWithContext(context.Background()) 243 } 244 245 func (i CustomPluginArray) ToCustomPluginArrayOutputWithContext(ctx context.Context) CustomPluginArrayOutput { 246 return pulumi.ToOutputWithContext(ctx, i).(CustomPluginArrayOutput) 247 } 248 249 // CustomPluginMapInput is an input type that accepts CustomPluginMap and CustomPluginMapOutput values. 250 // You can construct a concrete instance of `CustomPluginMapInput` via: 251 // 252 // CustomPluginMap{ "key": CustomPluginArgs{...} } 253 type CustomPluginMapInput interface { 254 pulumi.Input 255 256 ToCustomPluginMapOutput() CustomPluginMapOutput 257 ToCustomPluginMapOutputWithContext(context.Context) CustomPluginMapOutput 258 } 259 260 type CustomPluginMap map[string]CustomPluginInput 261 262 func (CustomPluginMap) ElementType() reflect.Type { 263 return reflect.TypeOf((*map[string]*CustomPlugin)(nil)).Elem() 264 } 265 266 func (i CustomPluginMap) ToCustomPluginMapOutput() CustomPluginMapOutput { 267 return i.ToCustomPluginMapOutputWithContext(context.Background()) 268 } 269 270 func (i CustomPluginMap) ToCustomPluginMapOutputWithContext(ctx context.Context) CustomPluginMapOutput { 271 return pulumi.ToOutputWithContext(ctx, i).(CustomPluginMapOutput) 272 } 273 274 type CustomPluginOutput struct{ *pulumi.OutputState } 275 276 func (CustomPluginOutput) ElementType() reflect.Type { 277 return reflect.TypeOf((**CustomPlugin)(nil)).Elem() 278 } 279 280 func (o CustomPluginOutput) ToCustomPluginOutput() CustomPluginOutput { 281 return o 282 } 283 284 func (o CustomPluginOutput) ToCustomPluginOutputWithContext(ctx context.Context) CustomPluginOutput { 285 return o 286 } 287 288 // the Amazon Resource Name (ARN) of the custom plugin. 289 func (o CustomPluginOutput) Arn() pulumi.StringOutput { 290 return o.ApplyT(func(v *CustomPlugin) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 291 } 292 293 // The type of the plugin file. Allowed values are `ZIP` and `JAR`. 294 func (o CustomPluginOutput) ContentType() pulumi.StringOutput { 295 return o.ApplyT(func(v *CustomPlugin) pulumi.StringOutput { return v.ContentType }).(pulumi.StringOutput) 296 } 297 298 // A summary description of the custom plugin. 299 func (o CustomPluginOutput) Description() pulumi.StringPtrOutput { 300 return o.ApplyT(func(v *CustomPlugin) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 301 } 302 303 // an ID of the latest successfully created revision of the custom plugin. 304 func (o CustomPluginOutput) LatestRevision() pulumi.IntOutput { 305 return o.ApplyT(func(v *CustomPlugin) pulumi.IntOutput { return v.LatestRevision }).(pulumi.IntOutput) 306 } 307 308 // Information about the location of a custom plugin. See below. 309 // 310 // The following arguments are optional: 311 func (o CustomPluginOutput) Location() CustomPluginLocationOutput { 312 return o.ApplyT(func(v *CustomPlugin) CustomPluginLocationOutput { return v.Location }).(CustomPluginLocationOutput) 313 } 314 315 // The name of the custom plugin.. 316 func (o CustomPluginOutput) Name() pulumi.StringOutput { 317 return o.ApplyT(func(v *CustomPlugin) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 318 } 319 320 // the state of the custom plugin. 321 func (o CustomPluginOutput) State() pulumi.StringOutput { 322 return o.ApplyT(func(v *CustomPlugin) pulumi.StringOutput { return v.State }).(pulumi.StringOutput) 323 } 324 325 type CustomPluginArrayOutput struct{ *pulumi.OutputState } 326 327 func (CustomPluginArrayOutput) ElementType() reflect.Type { 328 return reflect.TypeOf((*[]*CustomPlugin)(nil)).Elem() 329 } 330 331 func (o CustomPluginArrayOutput) ToCustomPluginArrayOutput() CustomPluginArrayOutput { 332 return o 333 } 334 335 func (o CustomPluginArrayOutput) ToCustomPluginArrayOutputWithContext(ctx context.Context) CustomPluginArrayOutput { 336 return o 337 } 338 339 func (o CustomPluginArrayOutput) Index(i pulumi.IntInput) CustomPluginOutput { 340 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomPlugin { 341 return vs[0].([]*CustomPlugin)[vs[1].(int)] 342 }).(CustomPluginOutput) 343 } 344 345 type CustomPluginMapOutput struct{ *pulumi.OutputState } 346 347 func (CustomPluginMapOutput) ElementType() reflect.Type { 348 return reflect.TypeOf((*map[string]*CustomPlugin)(nil)).Elem() 349 } 350 351 func (o CustomPluginMapOutput) ToCustomPluginMapOutput() CustomPluginMapOutput { 352 return o 353 } 354 355 func (o CustomPluginMapOutput) ToCustomPluginMapOutputWithContext(ctx context.Context) CustomPluginMapOutput { 356 return o 357 } 358 359 func (o CustomPluginMapOutput) MapIndex(k pulumi.StringInput) CustomPluginOutput { 360 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomPlugin { 361 return vs[0].(map[string]*CustomPlugin)[vs[1].(string)] 362 }).(CustomPluginOutput) 363 } 364 365 func init() { 366 pulumi.RegisterInputType(reflect.TypeOf((*CustomPluginInput)(nil)).Elem(), &CustomPlugin{}) 367 pulumi.RegisterInputType(reflect.TypeOf((*CustomPluginArrayInput)(nil)).Elem(), CustomPluginArray{}) 368 pulumi.RegisterInputType(reflect.TypeOf((*CustomPluginMapInput)(nil)).Elem(), CustomPluginMap{}) 369 pulumi.RegisterOutputType(CustomPluginOutput{}) 370 pulumi.RegisterOutputType(CustomPluginArrayOutput{}) 371 pulumi.RegisterOutputType(CustomPluginMapOutput{}) 372 }