github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/msk/serverlessCluster.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 msk 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 // Manages an Amazon MSK Serverless cluster. 16 // 17 // > **Note:** To manage a _provisioned_ Amazon MSK cluster, use the `msk.Cluster` resource. 18 // 19 // ## Example Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/msk" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := msk.NewServerlessCluster(ctx, "example", &msk.ServerlessClusterArgs{ 34 // ClusterName: pulumi.String("Example"), 35 // VpcConfigs: msk.ServerlessClusterVpcConfigArray{ 36 // &msk.ServerlessClusterVpcConfigArgs{ 37 // SubnetIds: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:3,24-46), 38 // SecurityGroupIds: pulumi.StringArray{ 39 // exampleAwsSecurityGroup.Id, 40 // }, 41 // }, 42 // }, 43 // ClientAuthentication: &msk.ServerlessClusterClientAuthenticationArgs{ 44 // Sasl: &msk.ServerlessClusterClientAuthenticationSaslArgs{ 45 // Iam: &msk.ServerlessClusterClientAuthenticationSaslIamArgs{ 46 // Enabled: pulumi.Bool(true), 47 // }, 48 // }, 49 // }, 50 // }) 51 // if err != nil { 52 // return err 53 // } 54 // return nil 55 // }) 56 // } 57 // ``` 58 // <!--End PulumiCodeChooser --> 59 // 60 // ## Import 61 // 62 // Using `pulumi import`, import MSK serverless clusters using the cluster `arn`. For example: 63 // 64 // ```sh 65 // $ pulumi import aws:msk/serverlessCluster:ServerlessCluster example arn:aws:kafka:us-west-2:123456789012:cluster/example/279c0212-d057-4dba-9aa9-1c4e5a25bfc7-3 66 // ``` 67 type ServerlessCluster struct { 68 pulumi.CustomResourceState 69 70 // The ARN of the serverless cluster. 71 Arn pulumi.StringOutput `pulumi:"arn"` 72 // Specifies client authentication information for the serverless cluster. See below. 73 ClientAuthentication ServerlessClusterClientAuthenticationOutput `pulumi:"clientAuthentication"` 74 // The name of the serverless cluster. 75 ClusterName pulumi.StringOutput `pulumi:"clusterName"` 76 // UUID of the serverless cluster, for use in IAM policies. 77 ClusterUuid pulumi.StringOutput `pulumi:"clusterUuid"` 78 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 79 Tags pulumi.StringMapOutput `pulumi:"tags"` 80 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 81 // 82 // Deprecated: Please use `tags` instead. 83 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 84 // VPC configuration information. See below. 85 VpcConfigs ServerlessClusterVpcConfigArrayOutput `pulumi:"vpcConfigs"` 86 } 87 88 // NewServerlessCluster registers a new resource with the given unique name, arguments, and options. 89 func NewServerlessCluster(ctx *pulumi.Context, 90 name string, args *ServerlessClusterArgs, opts ...pulumi.ResourceOption) (*ServerlessCluster, error) { 91 if args == nil { 92 return nil, errors.New("missing one or more required arguments") 93 } 94 95 if args.ClientAuthentication == nil { 96 return nil, errors.New("invalid value for required argument 'ClientAuthentication'") 97 } 98 if args.VpcConfigs == nil { 99 return nil, errors.New("invalid value for required argument 'VpcConfigs'") 100 } 101 opts = internal.PkgResourceDefaultOpts(opts) 102 var resource ServerlessCluster 103 err := ctx.RegisterResource("aws:msk/serverlessCluster:ServerlessCluster", name, args, &resource, opts...) 104 if err != nil { 105 return nil, err 106 } 107 return &resource, nil 108 } 109 110 // GetServerlessCluster gets an existing ServerlessCluster resource's state with the given name, ID, and optional 111 // state properties that are used to uniquely qualify the lookup (nil if not required). 112 func GetServerlessCluster(ctx *pulumi.Context, 113 name string, id pulumi.IDInput, state *ServerlessClusterState, opts ...pulumi.ResourceOption) (*ServerlessCluster, error) { 114 var resource ServerlessCluster 115 err := ctx.ReadResource("aws:msk/serverlessCluster:ServerlessCluster", name, id, state, &resource, opts...) 116 if err != nil { 117 return nil, err 118 } 119 return &resource, nil 120 } 121 122 // Input properties used for looking up and filtering ServerlessCluster resources. 123 type serverlessClusterState struct { 124 // The ARN of the serverless cluster. 125 Arn *string `pulumi:"arn"` 126 // Specifies client authentication information for the serverless cluster. See below. 127 ClientAuthentication *ServerlessClusterClientAuthentication `pulumi:"clientAuthentication"` 128 // The name of the serverless cluster. 129 ClusterName *string `pulumi:"clusterName"` 130 // UUID of the serverless cluster, for use in IAM policies. 131 ClusterUuid *string `pulumi:"clusterUuid"` 132 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 133 Tags map[string]string `pulumi:"tags"` 134 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 135 // 136 // Deprecated: Please use `tags` instead. 137 TagsAll map[string]string `pulumi:"tagsAll"` 138 // VPC configuration information. See below. 139 VpcConfigs []ServerlessClusterVpcConfig `pulumi:"vpcConfigs"` 140 } 141 142 type ServerlessClusterState struct { 143 // The ARN of the serverless cluster. 144 Arn pulumi.StringPtrInput 145 // Specifies client authentication information for the serverless cluster. See below. 146 ClientAuthentication ServerlessClusterClientAuthenticationPtrInput 147 // The name of the serverless cluster. 148 ClusterName pulumi.StringPtrInput 149 // UUID of the serverless cluster, for use in IAM policies. 150 ClusterUuid pulumi.StringPtrInput 151 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 152 Tags pulumi.StringMapInput 153 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 154 // 155 // Deprecated: Please use `tags` instead. 156 TagsAll pulumi.StringMapInput 157 // VPC configuration information. See below. 158 VpcConfigs ServerlessClusterVpcConfigArrayInput 159 } 160 161 func (ServerlessClusterState) ElementType() reflect.Type { 162 return reflect.TypeOf((*serverlessClusterState)(nil)).Elem() 163 } 164 165 type serverlessClusterArgs struct { 166 // Specifies client authentication information for the serverless cluster. See below. 167 ClientAuthentication ServerlessClusterClientAuthentication `pulumi:"clientAuthentication"` 168 // The name of the serverless cluster. 169 ClusterName *string `pulumi:"clusterName"` 170 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 171 Tags map[string]string `pulumi:"tags"` 172 // VPC configuration information. See below. 173 VpcConfigs []ServerlessClusterVpcConfig `pulumi:"vpcConfigs"` 174 } 175 176 // The set of arguments for constructing a ServerlessCluster resource. 177 type ServerlessClusterArgs struct { 178 // Specifies client authentication information for the serverless cluster. See below. 179 ClientAuthentication ServerlessClusterClientAuthenticationInput 180 // The name of the serverless cluster. 181 ClusterName pulumi.StringPtrInput 182 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 183 Tags pulumi.StringMapInput 184 // VPC configuration information. See below. 185 VpcConfigs ServerlessClusterVpcConfigArrayInput 186 } 187 188 func (ServerlessClusterArgs) ElementType() reflect.Type { 189 return reflect.TypeOf((*serverlessClusterArgs)(nil)).Elem() 190 } 191 192 type ServerlessClusterInput interface { 193 pulumi.Input 194 195 ToServerlessClusterOutput() ServerlessClusterOutput 196 ToServerlessClusterOutputWithContext(ctx context.Context) ServerlessClusterOutput 197 } 198 199 func (*ServerlessCluster) ElementType() reflect.Type { 200 return reflect.TypeOf((**ServerlessCluster)(nil)).Elem() 201 } 202 203 func (i *ServerlessCluster) ToServerlessClusterOutput() ServerlessClusterOutput { 204 return i.ToServerlessClusterOutputWithContext(context.Background()) 205 } 206 207 func (i *ServerlessCluster) ToServerlessClusterOutputWithContext(ctx context.Context) ServerlessClusterOutput { 208 return pulumi.ToOutputWithContext(ctx, i).(ServerlessClusterOutput) 209 } 210 211 // ServerlessClusterArrayInput is an input type that accepts ServerlessClusterArray and ServerlessClusterArrayOutput values. 212 // You can construct a concrete instance of `ServerlessClusterArrayInput` via: 213 // 214 // ServerlessClusterArray{ ServerlessClusterArgs{...} } 215 type ServerlessClusterArrayInput interface { 216 pulumi.Input 217 218 ToServerlessClusterArrayOutput() ServerlessClusterArrayOutput 219 ToServerlessClusterArrayOutputWithContext(context.Context) ServerlessClusterArrayOutput 220 } 221 222 type ServerlessClusterArray []ServerlessClusterInput 223 224 func (ServerlessClusterArray) ElementType() reflect.Type { 225 return reflect.TypeOf((*[]*ServerlessCluster)(nil)).Elem() 226 } 227 228 func (i ServerlessClusterArray) ToServerlessClusterArrayOutput() ServerlessClusterArrayOutput { 229 return i.ToServerlessClusterArrayOutputWithContext(context.Background()) 230 } 231 232 func (i ServerlessClusterArray) ToServerlessClusterArrayOutputWithContext(ctx context.Context) ServerlessClusterArrayOutput { 233 return pulumi.ToOutputWithContext(ctx, i).(ServerlessClusterArrayOutput) 234 } 235 236 // ServerlessClusterMapInput is an input type that accepts ServerlessClusterMap and ServerlessClusterMapOutput values. 237 // You can construct a concrete instance of `ServerlessClusterMapInput` via: 238 // 239 // ServerlessClusterMap{ "key": ServerlessClusterArgs{...} } 240 type ServerlessClusterMapInput interface { 241 pulumi.Input 242 243 ToServerlessClusterMapOutput() ServerlessClusterMapOutput 244 ToServerlessClusterMapOutputWithContext(context.Context) ServerlessClusterMapOutput 245 } 246 247 type ServerlessClusterMap map[string]ServerlessClusterInput 248 249 func (ServerlessClusterMap) ElementType() reflect.Type { 250 return reflect.TypeOf((*map[string]*ServerlessCluster)(nil)).Elem() 251 } 252 253 func (i ServerlessClusterMap) ToServerlessClusterMapOutput() ServerlessClusterMapOutput { 254 return i.ToServerlessClusterMapOutputWithContext(context.Background()) 255 } 256 257 func (i ServerlessClusterMap) ToServerlessClusterMapOutputWithContext(ctx context.Context) ServerlessClusterMapOutput { 258 return pulumi.ToOutputWithContext(ctx, i).(ServerlessClusterMapOutput) 259 } 260 261 type ServerlessClusterOutput struct{ *pulumi.OutputState } 262 263 func (ServerlessClusterOutput) ElementType() reflect.Type { 264 return reflect.TypeOf((**ServerlessCluster)(nil)).Elem() 265 } 266 267 func (o ServerlessClusterOutput) ToServerlessClusterOutput() ServerlessClusterOutput { 268 return o 269 } 270 271 func (o ServerlessClusterOutput) ToServerlessClusterOutputWithContext(ctx context.Context) ServerlessClusterOutput { 272 return o 273 } 274 275 // The ARN of the serverless cluster. 276 func (o ServerlessClusterOutput) Arn() pulumi.StringOutput { 277 return o.ApplyT(func(v *ServerlessCluster) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 278 } 279 280 // Specifies client authentication information for the serverless cluster. See below. 281 func (o ServerlessClusterOutput) ClientAuthentication() ServerlessClusterClientAuthenticationOutput { 282 return o.ApplyT(func(v *ServerlessCluster) ServerlessClusterClientAuthenticationOutput { return v.ClientAuthentication }).(ServerlessClusterClientAuthenticationOutput) 283 } 284 285 // The name of the serverless cluster. 286 func (o ServerlessClusterOutput) ClusterName() pulumi.StringOutput { 287 return o.ApplyT(func(v *ServerlessCluster) pulumi.StringOutput { return v.ClusterName }).(pulumi.StringOutput) 288 } 289 290 // UUID of the serverless cluster, for use in IAM policies. 291 func (o ServerlessClusterOutput) ClusterUuid() pulumi.StringOutput { 292 return o.ApplyT(func(v *ServerlessCluster) pulumi.StringOutput { return v.ClusterUuid }).(pulumi.StringOutput) 293 } 294 295 // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 296 func (o ServerlessClusterOutput) Tags() pulumi.StringMapOutput { 297 return o.ApplyT(func(v *ServerlessCluster) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 298 } 299 300 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 301 // 302 // Deprecated: Please use `tags` instead. 303 func (o ServerlessClusterOutput) TagsAll() pulumi.StringMapOutput { 304 return o.ApplyT(func(v *ServerlessCluster) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 305 } 306 307 // VPC configuration information. See below. 308 func (o ServerlessClusterOutput) VpcConfigs() ServerlessClusterVpcConfigArrayOutput { 309 return o.ApplyT(func(v *ServerlessCluster) ServerlessClusterVpcConfigArrayOutput { return v.VpcConfigs }).(ServerlessClusterVpcConfigArrayOutput) 310 } 311 312 type ServerlessClusterArrayOutput struct{ *pulumi.OutputState } 313 314 func (ServerlessClusterArrayOutput) ElementType() reflect.Type { 315 return reflect.TypeOf((*[]*ServerlessCluster)(nil)).Elem() 316 } 317 318 func (o ServerlessClusterArrayOutput) ToServerlessClusterArrayOutput() ServerlessClusterArrayOutput { 319 return o 320 } 321 322 func (o ServerlessClusterArrayOutput) ToServerlessClusterArrayOutputWithContext(ctx context.Context) ServerlessClusterArrayOutput { 323 return o 324 } 325 326 func (o ServerlessClusterArrayOutput) Index(i pulumi.IntInput) ServerlessClusterOutput { 327 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServerlessCluster { 328 return vs[0].([]*ServerlessCluster)[vs[1].(int)] 329 }).(ServerlessClusterOutput) 330 } 331 332 type ServerlessClusterMapOutput struct{ *pulumi.OutputState } 333 334 func (ServerlessClusterMapOutput) ElementType() reflect.Type { 335 return reflect.TypeOf((*map[string]*ServerlessCluster)(nil)).Elem() 336 } 337 338 func (o ServerlessClusterMapOutput) ToServerlessClusterMapOutput() ServerlessClusterMapOutput { 339 return o 340 } 341 342 func (o ServerlessClusterMapOutput) ToServerlessClusterMapOutputWithContext(ctx context.Context) ServerlessClusterMapOutput { 343 return o 344 } 345 346 func (o ServerlessClusterMapOutput) MapIndex(k pulumi.StringInput) ServerlessClusterOutput { 347 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServerlessCluster { 348 return vs[0].(map[string]*ServerlessCluster)[vs[1].(string)] 349 }).(ServerlessClusterOutput) 350 } 351 352 func init() { 353 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessClusterInput)(nil)).Elem(), &ServerlessCluster{}) 354 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessClusterArrayInput)(nil)).Elem(), ServerlessClusterArray{}) 355 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessClusterMapInput)(nil)).Elem(), ServerlessClusterMap{}) 356 pulumi.RegisterOutputType(ServerlessClusterOutput{}) 357 pulumi.RegisterOutputType(ServerlessClusterArrayOutput{}) 358 pulumi.RegisterOutputType(ServerlessClusterMapOutput{}) 359 }