github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/medialive/multiplexProgram.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 MultiplexProgram.
    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  //			example, 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  //			_, err = medialive.NewMultiplexProgram(ctx, "example", &medialive.MultiplexProgramArgs{
    62  //				ProgramName: pulumi.String("example_program"),
    63  //				MultiplexId: example.ID(),
    64  //				MultiplexProgramSettings: &medialive.MultiplexProgramMultiplexProgramSettingsArgs{
    65  //					ProgramNumber:            pulumi.Int(1),
    66  //					PreferredChannelPipeline: pulumi.String("CURRENTLY_ACTIVE"),
    67  //					VideoSettings: &medialive.MultiplexProgramMultiplexProgramSettingsVideoSettingsArgs{
    68  //						ConstantBitrate: pulumi.Int(100000),
    69  //					},
    70  //				},
    71  //			})
    72  //			if err != nil {
    73  //				return err
    74  //			}
    75  //			return nil
    76  //		})
    77  //	}
    78  //
    79  // ```
    80  // <!--End PulumiCodeChooser -->
    81  //
    82  // ## Import
    83  //
    84  // Using `pulumi import`, import MediaLive MultiplexProgram using the `id`, or a combination of "`program_name`/`multiplex_id`". For example:
    85  //
    86  // ```sh
    87  // $ pulumi import aws:medialive/multiplexProgram:MultiplexProgram example example_program/1234567
    88  // ```
    89  type MultiplexProgram struct {
    90  	pulumi.CustomResourceState
    91  
    92  	// Multiplex ID.
    93  	MultiplexId pulumi.StringOutput `pulumi:"multiplexId"`
    94  	// MultiplexProgram settings. See Multiplex Program Settings for more details.
    95  	//
    96  	// The following arguments are optional:
    97  	MultiplexProgramSettings MultiplexProgramMultiplexProgramSettingsPtrOutput `pulumi:"multiplexProgramSettings"`
    98  	// Unique program name.
    99  	ProgramName pulumi.StringOutput `pulumi:"programName"`
   100  }
   101  
   102  // NewMultiplexProgram registers a new resource with the given unique name, arguments, and options.
   103  func NewMultiplexProgram(ctx *pulumi.Context,
   104  	name string, args *MultiplexProgramArgs, opts ...pulumi.ResourceOption) (*MultiplexProgram, error) {
   105  	if args == nil {
   106  		return nil, errors.New("missing one or more required arguments")
   107  	}
   108  
   109  	if args.MultiplexId == nil {
   110  		return nil, errors.New("invalid value for required argument 'MultiplexId'")
   111  	}
   112  	if args.ProgramName == nil {
   113  		return nil, errors.New("invalid value for required argument 'ProgramName'")
   114  	}
   115  	opts = internal.PkgResourceDefaultOpts(opts)
   116  	var resource MultiplexProgram
   117  	err := ctx.RegisterResource("aws:medialive/multiplexProgram:MultiplexProgram", name, args, &resource, opts...)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	return &resource, nil
   122  }
   123  
   124  // GetMultiplexProgram gets an existing MultiplexProgram resource's state with the given name, ID, and optional
   125  // state properties that are used to uniquely qualify the lookup (nil if not required).
   126  func GetMultiplexProgram(ctx *pulumi.Context,
   127  	name string, id pulumi.IDInput, state *MultiplexProgramState, opts ...pulumi.ResourceOption) (*MultiplexProgram, error) {
   128  	var resource MultiplexProgram
   129  	err := ctx.ReadResource("aws:medialive/multiplexProgram:MultiplexProgram", name, id, state, &resource, opts...)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return &resource, nil
   134  }
   135  
   136  // Input properties used for looking up and filtering MultiplexProgram resources.
   137  type multiplexProgramState struct {
   138  	// Multiplex ID.
   139  	MultiplexId *string `pulumi:"multiplexId"`
   140  	// MultiplexProgram settings. See Multiplex Program Settings for more details.
   141  	//
   142  	// The following arguments are optional:
   143  	MultiplexProgramSettings *MultiplexProgramMultiplexProgramSettings `pulumi:"multiplexProgramSettings"`
   144  	// Unique program name.
   145  	ProgramName *string `pulumi:"programName"`
   146  }
   147  
   148  type MultiplexProgramState struct {
   149  	// Multiplex ID.
   150  	MultiplexId pulumi.StringPtrInput
   151  	// MultiplexProgram settings. See Multiplex Program Settings for more details.
   152  	//
   153  	// The following arguments are optional:
   154  	MultiplexProgramSettings MultiplexProgramMultiplexProgramSettingsPtrInput
   155  	// Unique program name.
   156  	ProgramName pulumi.StringPtrInput
   157  }
   158  
   159  func (MultiplexProgramState) ElementType() reflect.Type {
   160  	return reflect.TypeOf((*multiplexProgramState)(nil)).Elem()
   161  }
   162  
   163  type multiplexProgramArgs struct {
   164  	// Multiplex ID.
   165  	MultiplexId string `pulumi:"multiplexId"`
   166  	// MultiplexProgram settings. See Multiplex Program Settings for more details.
   167  	//
   168  	// The following arguments are optional:
   169  	MultiplexProgramSettings *MultiplexProgramMultiplexProgramSettings `pulumi:"multiplexProgramSettings"`
   170  	// Unique program name.
   171  	ProgramName string `pulumi:"programName"`
   172  }
   173  
   174  // The set of arguments for constructing a MultiplexProgram resource.
   175  type MultiplexProgramArgs struct {
   176  	// Multiplex ID.
   177  	MultiplexId pulumi.StringInput
   178  	// MultiplexProgram settings. See Multiplex Program Settings for more details.
   179  	//
   180  	// The following arguments are optional:
   181  	MultiplexProgramSettings MultiplexProgramMultiplexProgramSettingsPtrInput
   182  	// Unique program name.
   183  	ProgramName pulumi.StringInput
   184  }
   185  
   186  func (MultiplexProgramArgs) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*multiplexProgramArgs)(nil)).Elem()
   188  }
   189  
   190  type MultiplexProgramInput interface {
   191  	pulumi.Input
   192  
   193  	ToMultiplexProgramOutput() MultiplexProgramOutput
   194  	ToMultiplexProgramOutputWithContext(ctx context.Context) MultiplexProgramOutput
   195  }
   196  
   197  func (*MultiplexProgram) ElementType() reflect.Type {
   198  	return reflect.TypeOf((**MultiplexProgram)(nil)).Elem()
   199  }
   200  
   201  func (i *MultiplexProgram) ToMultiplexProgramOutput() MultiplexProgramOutput {
   202  	return i.ToMultiplexProgramOutputWithContext(context.Background())
   203  }
   204  
   205  func (i *MultiplexProgram) ToMultiplexProgramOutputWithContext(ctx context.Context) MultiplexProgramOutput {
   206  	return pulumi.ToOutputWithContext(ctx, i).(MultiplexProgramOutput)
   207  }
   208  
   209  // MultiplexProgramArrayInput is an input type that accepts MultiplexProgramArray and MultiplexProgramArrayOutput values.
   210  // You can construct a concrete instance of `MultiplexProgramArrayInput` via:
   211  //
   212  //	MultiplexProgramArray{ MultiplexProgramArgs{...} }
   213  type MultiplexProgramArrayInput interface {
   214  	pulumi.Input
   215  
   216  	ToMultiplexProgramArrayOutput() MultiplexProgramArrayOutput
   217  	ToMultiplexProgramArrayOutputWithContext(context.Context) MultiplexProgramArrayOutput
   218  }
   219  
   220  type MultiplexProgramArray []MultiplexProgramInput
   221  
   222  func (MultiplexProgramArray) ElementType() reflect.Type {
   223  	return reflect.TypeOf((*[]*MultiplexProgram)(nil)).Elem()
   224  }
   225  
   226  func (i MultiplexProgramArray) ToMultiplexProgramArrayOutput() MultiplexProgramArrayOutput {
   227  	return i.ToMultiplexProgramArrayOutputWithContext(context.Background())
   228  }
   229  
   230  func (i MultiplexProgramArray) ToMultiplexProgramArrayOutputWithContext(ctx context.Context) MultiplexProgramArrayOutput {
   231  	return pulumi.ToOutputWithContext(ctx, i).(MultiplexProgramArrayOutput)
   232  }
   233  
   234  // MultiplexProgramMapInput is an input type that accepts MultiplexProgramMap and MultiplexProgramMapOutput values.
   235  // You can construct a concrete instance of `MultiplexProgramMapInput` via:
   236  //
   237  //	MultiplexProgramMap{ "key": MultiplexProgramArgs{...} }
   238  type MultiplexProgramMapInput interface {
   239  	pulumi.Input
   240  
   241  	ToMultiplexProgramMapOutput() MultiplexProgramMapOutput
   242  	ToMultiplexProgramMapOutputWithContext(context.Context) MultiplexProgramMapOutput
   243  }
   244  
   245  type MultiplexProgramMap map[string]MultiplexProgramInput
   246  
   247  func (MultiplexProgramMap) ElementType() reflect.Type {
   248  	return reflect.TypeOf((*map[string]*MultiplexProgram)(nil)).Elem()
   249  }
   250  
   251  func (i MultiplexProgramMap) ToMultiplexProgramMapOutput() MultiplexProgramMapOutput {
   252  	return i.ToMultiplexProgramMapOutputWithContext(context.Background())
   253  }
   254  
   255  func (i MultiplexProgramMap) ToMultiplexProgramMapOutputWithContext(ctx context.Context) MultiplexProgramMapOutput {
   256  	return pulumi.ToOutputWithContext(ctx, i).(MultiplexProgramMapOutput)
   257  }
   258  
   259  type MultiplexProgramOutput struct{ *pulumi.OutputState }
   260  
   261  func (MultiplexProgramOutput) ElementType() reflect.Type {
   262  	return reflect.TypeOf((**MultiplexProgram)(nil)).Elem()
   263  }
   264  
   265  func (o MultiplexProgramOutput) ToMultiplexProgramOutput() MultiplexProgramOutput {
   266  	return o
   267  }
   268  
   269  func (o MultiplexProgramOutput) ToMultiplexProgramOutputWithContext(ctx context.Context) MultiplexProgramOutput {
   270  	return o
   271  }
   272  
   273  // Multiplex ID.
   274  func (o MultiplexProgramOutput) MultiplexId() pulumi.StringOutput {
   275  	return o.ApplyT(func(v *MultiplexProgram) pulumi.StringOutput { return v.MultiplexId }).(pulumi.StringOutput)
   276  }
   277  
   278  // MultiplexProgram settings. See Multiplex Program Settings for more details.
   279  //
   280  // The following arguments are optional:
   281  func (o MultiplexProgramOutput) MultiplexProgramSettings() MultiplexProgramMultiplexProgramSettingsPtrOutput {
   282  	return o.ApplyT(func(v *MultiplexProgram) MultiplexProgramMultiplexProgramSettingsPtrOutput {
   283  		return v.MultiplexProgramSettings
   284  	}).(MultiplexProgramMultiplexProgramSettingsPtrOutput)
   285  }
   286  
   287  // Unique program name.
   288  func (o MultiplexProgramOutput) ProgramName() pulumi.StringOutput {
   289  	return o.ApplyT(func(v *MultiplexProgram) pulumi.StringOutput { return v.ProgramName }).(pulumi.StringOutput)
   290  }
   291  
   292  type MultiplexProgramArrayOutput struct{ *pulumi.OutputState }
   293  
   294  func (MultiplexProgramArrayOutput) ElementType() reflect.Type {
   295  	return reflect.TypeOf((*[]*MultiplexProgram)(nil)).Elem()
   296  }
   297  
   298  func (o MultiplexProgramArrayOutput) ToMultiplexProgramArrayOutput() MultiplexProgramArrayOutput {
   299  	return o
   300  }
   301  
   302  func (o MultiplexProgramArrayOutput) ToMultiplexProgramArrayOutputWithContext(ctx context.Context) MultiplexProgramArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o MultiplexProgramArrayOutput) Index(i pulumi.IntInput) MultiplexProgramOutput {
   307  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MultiplexProgram {
   308  		return vs[0].([]*MultiplexProgram)[vs[1].(int)]
   309  	}).(MultiplexProgramOutput)
   310  }
   311  
   312  type MultiplexProgramMapOutput struct{ *pulumi.OutputState }
   313  
   314  func (MultiplexProgramMapOutput) ElementType() reflect.Type {
   315  	return reflect.TypeOf((*map[string]*MultiplexProgram)(nil)).Elem()
   316  }
   317  
   318  func (o MultiplexProgramMapOutput) ToMultiplexProgramMapOutput() MultiplexProgramMapOutput {
   319  	return o
   320  }
   321  
   322  func (o MultiplexProgramMapOutput) ToMultiplexProgramMapOutputWithContext(ctx context.Context) MultiplexProgramMapOutput {
   323  	return o
   324  }
   325  
   326  func (o MultiplexProgramMapOutput) MapIndex(k pulumi.StringInput) MultiplexProgramOutput {
   327  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MultiplexProgram {
   328  		return vs[0].(map[string]*MultiplexProgram)[vs[1].(string)]
   329  	}).(MultiplexProgramOutput)
   330  }
   331  
   332  func init() {
   333  	pulumi.RegisterInputType(reflect.TypeOf((*MultiplexProgramInput)(nil)).Elem(), &MultiplexProgram{})
   334  	pulumi.RegisterInputType(reflect.TypeOf((*MultiplexProgramArrayInput)(nil)).Elem(), MultiplexProgramArray{})
   335  	pulumi.RegisterInputType(reflect.TypeOf((*MultiplexProgramMapInput)(nil)).Elem(), MultiplexProgramMap{})
   336  	pulumi.RegisterOutputType(MultiplexProgramOutput{})
   337  	pulumi.RegisterOutputType(MultiplexProgramArrayOutput{})
   338  	pulumi.RegisterOutputType(MultiplexProgramMapOutput{})
   339  }