github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/medialive/multiplex.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 medialive 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 // Resource for managing an AWS MediaLive Multiplex. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/medialive" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{ 36 // State: pulumi.StringRef("available"), 37 // }, nil) 38 // if err != nil { 39 // return err 40 // } 41 // _, err = medialive.NewMultiplex(ctx, "example", &medialive.MultiplexArgs{ 42 // Name: pulumi.String("example-multiplex-changed"), 43 // AvailabilityZones: pulumi.StringArray{ 44 // pulumi.String(available.Names[0]), 45 // pulumi.String(available.Names[1]), 46 // }, 47 // MultiplexSettings: &medialive.MultiplexMultiplexSettingsArgs{ 48 // TransportStreamBitrate: pulumi.Int(1000000), 49 // TransportStreamId: pulumi.Int(1), 50 // TransportStreamReservedBitrate: pulumi.Int(1), 51 // MaximumVideoBufferDelayMilliseconds: pulumi.Int(1000), 52 // }, 53 // StartMultiplex: pulumi.Bool(true), 54 // Tags: pulumi.StringMap{ 55 // "tag1": pulumi.String("value1"), 56 // }, 57 // }) 58 // if err != nil { 59 // return err 60 // } 61 // return nil 62 // }) 63 // } 64 // 65 // ``` 66 // <!--End PulumiCodeChooser --> 67 // 68 // ## Import 69 // 70 // Using `pulumi import`, import MediaLive Multiplex using the `id`. For example: 71 // 72 // ```sh 73 // $ pulumi import aws:medialive/multiplex:Multiplex example 12345678 74 // ``` 75 type Multiplex struct { 76 pulumi.CustomResourceState 77 78 // ARN of the Multiplex. 79 Arn pulumi.StringOutput `pulumi:"arn"` 80 // A list of availability zones. You must specify exactly two. 81 AvailabilityZones pulumi.StringArrayOutput `pulumi:"availabilityZones"` 82 // Multiplex settings. See Multiplex Settings for more details. 83 MultiplexSettings MultiplexMultiplexSettingsPtrOutput `pulumi:"multiplexSettings"` 84 // name of Multiplex. 85 // 86 // The following arguments are optional: 87 Name pulumi.StringOutput `pulumi:"name"` 88 // Whether to start the Multiplex. Defaults to `false`. 89 StartMultiplex pulumi.BoolPtrOutput `pulumi:"startMultiplex"` 90 // A map of tags to assign to the Multiplex. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 91 Tags pulumi.StringMapOutput `pulumi:"tags"` 92 // Deprecated: Please use `tags` instead. 93 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 94 } 95 96 // NewMultiplex registers a new resource with the given unique name, arguments, and options. 97 func NewMultiplex(ctx *pulumi.Context, 98 name string, args *MultiplexArgs, opts ...pulumi.ResourceOption) (*Multiplex, error) { 99 if args == nil { 100 return nil, errors.New("missing one or more required arguments") 101 } 102 103 if args.AvailabilityZones == nil { 104 return nil, errors.New("invalid value for required argument 'AvailabilityZones'") 105 } 106 opts = internal.PkgResourceDefaultOpts(opts) 107 var resource Multiplex 108 err := ctx.RegisterResource("aws:medialive/multiplex:Multiplex", name, args, &resource, opts...) 109 if err != nil { 110 return nil, err 111 } 112 return &resource, nil 113 } 114 115 // GetMultiplex gets an existing Multiplex resource's state with the given name, ID, and optional 116 // state properties that are used to uniquely qualify the lookup (nil if not required). 117 func GetMultiplex(ctx *pulumi.Context, 118 name string, id pulumi.IDInput, state *MultiplexState, opts ...pulumi.ResourceOption) (*Multiplex, error) { 119 var resource Multiplex 120 err := ctx.ReadResource("aws:medialive/multiplex:Multiplex", name, id, state, &resource, opts...) 121 if err != nil { 122 return nil, err 123 } 124 return &resource, nil 125 } 126 127 // Input properties used for looking up and filtering Multiplex resources. 128 type multiplexState struct { 129 // ARN of the Multiplex. 130 Arn *string `pulumi:"arn"` 131 // A list of availability zones. You must specify exactly two. 132 AvailabilityZones []string `pulumi:"availabilityZones"` 133 // Multiplex settings. See Multiplex Settings for more details. 134 MultiplexSettings *MultiplexMultiplexSettings `pulumi:"multiplexSettings"` 135 // name of Multiplex. 136 // 137 // The following arguments are optional: 138 Name *string `pulumi:"name"` 139 // Whether to start the Multiplex. Defaults to `false`. 140 StartMultiplex *bool `pulumi:"startMultiplex"` 141 // A map of tags to assign to the Multiplex. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 142 Tags map[string]string `pulumi:"tags"` 143 // Deprecated: Please use `tags` instead. 144 TagsAll map[string]string `pulumi:"tagsAll"` 145 } 146 147 type MultiplexState struct { 148 // ARN of the Multiplex. 149 Arn pulumi.StringPtrInput 150 // A list of availability zones. You must specify exactly two. 151 AvailabilityZones pulumi.StringArrayInput 152 // Multiplex settings. See Multiplex Settings for more details. 153 MultiplexSettings MultiplexMultiplexSettingsPtrInput 154 // name of Multiplex. 155 // 156 // The following arguments are optional: 157 Name pulumi.StringPtrInput 158 // Whether to start the Multiplex. Defaults to `false`. 159 StartMultiplex pulumi.BoolPtrInput 160 // A map of tags to assign to the Multiplex. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 161 Tags pulumi.StringMapInput 162 // Deprecated: Please use `tags` instead. 163 TagsAll pulumi.StringMapInput 164 } 165 166 func (MultiplexState) ElementType() reflect.Type { 167 return reflect.TypeOf((*multiplexState)(nil)).Elem() 168 } 169 170 type multiplexArgs struct { 171 // A list of availability zones. You must specify exactly two. 172 AvailabilityZones []string `pulumi:"availabilityZones"` 173 // Multiplex settings. See Multiplex Settings for more details. 174 MultiplexSettings *MultiplexMultiplexSettings `pulumi:"multiplexSettings"` 175 // name of Multiplex. 176 // 177 // The following arguments are optional: 178 Name *string `pulumi:"name"` 179 // Whether to start the Multiplex. Defaults to `false`. 180 StartMultiplex *bool `pulumi:"startMultiplex"` 181 // A map of tags to assign to the Multiplex. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 182 Tags map[string]string `pulumi:"tags"` 183 } 184 185 // The set of arguments for constructing a Multiplex resource. 186 type MultiplexArgs struct { 187 // A list of availability zones. You must specify exactly two. 188 AvailabilityZones pulumi.StringArrayInput 189 // Multiplex settings. See Multiplex Settings for more details. 190 MultiplexSettings MultiplexMultiplexSettingsPtrInput 191 // name of Multiplex. 192 // 193 // The following arguments are optional: 194 Name pulumi.StringPtrInput 195 // Whether to start the Multiplex. Defaults to `false`. 196 StartMultiplex pulumi.BoolPtrInput 197 // A map of tags to assign to the Multiplex. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 198 Tags pulumi.StringMapInput 199 } 200 201 func (MultiplexArgs) ElementType() reflect.Type { 202 return reflect.TypeOf((*multiplexArgs)(nil)).Elem() 203 } 204 205 type MultiplexInput interface { 206 pulumi.Input 207 208 ToMultiplexOutput() MultiplexOutput 209 ToMultiplexOutputWithContext(ctx context.Context) MultiplexOutput 210 } 211 212 func (*Multiplex) ElementType() reflect.Type { 213 return reflect.TypeOf((**Multiplex)(nil)).Elem() 214 } 215 216 func (i *Multiplex) ToMultiplexOutput() MultiplexOutput { 217 return i.ToMultiplexOutputWithContext(context.Background()) 218 } 219 220 func (i *Multiplex) ToMultiplexOutputWithContext(ctx context.Context) MultiplexOutput { 221 return pulumi.ToOutputWithContext(ctx, i).(MultiplexOutput) 222 } 223 224 // MultiplexArrayInput is an input type that accepts MultiplexArray and MultiplexArrayOutput values. 225 // You can construct a concrete instance of `MultiplexArrayInput` via: 226 // 227 // MultiplexArray{ MultiplexArgs{...} } 228 type MultiplexArrayInput interface { 229 pulumi.Input 230 231 ToMultiplexArrayOutput() MultiplexArrayOutput 232 ToMultiplexArrayOutputWithContext(context.Context) MultiplexArrayOutput 233 } 234 235 type MultiplexArray []MultiplexInput 236 237 func (MultiplexArray) ElementType() reflect.Type { 238 return reflect.TypeOf((*[]*Multiplex)(nil)).Elem() 239 } 240 241 func (i MultiplexArray) ToMultiplexArrayOutput() MultiplexArrayOutput { 242 return i.ToMultiplexArrayOutputWithContext(context.Background()) 243 } 244 245 func (i MultiplexArray) ToMultiplexArrayOutputWithContext(ctx context.Context) MultiplexArrayOutput { 246 return pulumi.ToOutputWithContext(ctx, i).(MultiplexArrayOutput) 247 } 248 249 // MultiplexMapInput is an input type that accepts MultiplexMap and MultiplexMapOutput values. 250 // You can construct a concrete instance of `MultiplexMapInput` via: 251 // 252 // MultiplexMap{ "key": MultiplexArgs{...} } 253 type MultiplexMapInput interface { 254 pulumi.Input 255 256 ToMultiplexMapOutput() MultiplexMapOutput 257 ToMultiplexMapOutputWithContext(context.Context) MultiplexMapOutput 258 } 259 260 type MultiplexMap map[string]MultiplexInput 261 262 func (MultiplexMap) ElementType() reflect.Type { 263 return reflect.TypeOf((*map[string]*Multiplex)(nil)).Elem() 264 } 265 266 func (i MultiplexMap) ToMultiplexMapOutput() MultiplexMapOutput { 267 return i.ToMultiplexMapOutputWithContext(context.Background()) 268 } 269 270 func (i MultiplexMap) ToMultiplexMapOutputWithContext(ctx context.Context) MultiplexMapOutput { 271 return pulumi.ToOutputWithContext(ctx, i).(MultiplexMapOutput) 272 } 273 274 type MultiplexOutput struct{ *pulumi.OutputState } 275 276 func (MultiplexOutput) ElementType() reflect.Type { 277 return reflect.TypeOf((**Multiplex)(nil)).Elem() 278 } 279 280 func (o MultiplexOutput) ToMultiplexOutput() MultiplexOutput { 281 return o 282 } 283 284 func (o MultiplexOutput) ToMultiplexOutputWithContext(ctx context.Context) MultiplexOutput { 285 return o 286 } 287 288 // ARN of the Multiplex. 289 func (o MultiplexOutput) Arn() pulumi.StringOutput { 290 return o.ApplyT(func(v *Multiplex) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 291 } 292 293 // A list of availability zones. You must specify exactly two. 294 func (o MultiplexOutput) AvailabilityZones() pulumi.StringArrayOutput { 295 return o.ApplyT(func(v *Multiplex) pulumi.StringArrayOutput { return v.AvailabilityZones }).(pulumi.StringArrayOutput) 296 } 297 298 // Multiplex settings. See Multiplex Settings for more details. 299 func (o MultiplexOutput) MultiplexSettings() MultiplexMultiplexSettingsPtrOutput { 300 return o.ApplyT(func(v *Multiplex) MultiplexMultiplexSettingsPtrOutput { return v.MultiplexSettings }).(MultiplexMultiplexSettingsPtrOutput) 301 } 302 303 // name of Multiplex. 304 // 305 // The following arguments are optional: 306 func (o MultiplexOutput) Name() pulumi.StringOutput { 307 return o.ApplyT(func(v *Multiplex) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 308 } 309 310 // Whether to start the Multiplex. Defaults to `false`. 311 func (o MultiplexOutput) StartMultiplex() pulumi.BoolPtrOutput { 312 return o.ApplyT(func(v *Multiplex) pulumi.BoolPtrOutput { return v.StartMultiplex }).(pulumi.BoolPtrOutput) 313 } 314 315 // A map of tags to assign to the Multiplex. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 316 func (o MultiplexOutput) Tags() pulumi.StringMapOutput { 317 return o.ApplyT(func(v *Multiplex) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 318 } 319 320 // Deprecated: Please use `tags` instead. 321 func (o MultiplexOutput) TagsAll() pulumi.StringMapOutput { 322 return o.ApplyT(func(v *Multiplex) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 323 } 324 325 type MultiplexArrayOutput struct{ *pulumi.OutputState } 326 327 func (MultiplexArrayOutput) ElementType() reflect.Type { 328 return reflect.TypeOf((*[]*Multiplex)(nil)).Elem() 329 } 330 331 func (o MultiplexArrayOutput) ToMultiplexArrayOutput() MultiplexArrayOutput { 332 return o 333 } 334 335 func (o MultiplexArrayOutput) ToMultiplexArrayOutputWithContext(ctx context.Context) MultiplexArrayOutput { 336 return o 337 } 338 339 func (o MultiplexArrayOutput) Index(i pulumi.IntInput) MultiplexOutput { 340 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Multiplex { 341 return vs[0].([]*Multiplex)[vs[1].(int)] 342 }).(MultiplexOutput) 343 } 344 345 type MultiplexMapOutput struct{ *pulumi.OutputState } 346 347 func (MultiplexMapOutput) ElementType() reflect.Type { 348 return reflect.TypeOf((*map[string]*Multiplex)(nil)).Elem() 349 } 350 351 func (o MultiplexMapOutput) ToMultiplexMapOutput() MultiplexMapOutput { 352 return o 353 } 354 355 func (o MultiplexMapOutput) ToMultiplexMapOutputWithContext(ctx context.Context) MultiplexMapOutput { 356 return o 357 } 358 359 func (o MultiplexMapOutput) MapIndex(k pulumi.StringInput) MultiplexOutput { 360 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Multiplex { 361 return vs[0].(map[string]*Multiplex)[vs[1].(string)] 362 }).(MultiplexOutput) 363 } 364 365 func init() { 366 pulumi.RegisterInputType(reflect.TypeOf((*MultiplexInput)(nil)).Elem(), &Multiplex{}) 367 pulumi.RegisterInputType(reflect.TypeOf((*MultiplexArrayInput)(nil)).Elem(), MultiplexArray{}) 368 pulumi.RegisterInputType(reflect.TypeOf((*MultiplexMapInput)(nil)).Elem(), MultiplexMap{}) 369 pulumi.RegisterOutputType(MultiplexOutput{}) 370 pulumi.RegisterOutputType(MultiplexArrayOutput{}) 371 pulumi.RegisterOutputType(MultiplexMapOutput{}) 372 }