github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ivs/channel.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 ivs
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Resource for managing an AWS IVS (Interactive Video) Channel.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ivs"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := ivs.NewChannel(ctx, "example", &ivs.ChannelArgs{
    34  //				Name: pulumi.String("channel-1"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import IVS (Interactive Video) Channel using the ARN. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:ivs/channel:Channel example arn:aws:ivs:us-west-2:326937407773:channel/0Y1lcs4U7jk5
    52  // ```
    53  type Channel struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// ARN of the Channel.
    57  	Arn pulumi.StringOutput `pulumi:"arn"`
    58  	// If `true`, channel is private (enabled for playback authorization).
    59  	Authorized pulumi.BoolOutput `pulumi:"authorized"`
    60  	// Channel ingest endpoint, part of the definition of an ingest server, used when setting up streaming software.
    61  	IngestEndpoint pulumi.StringOutput `pulumi:"ingestEndpoint"`
    62  	// Channel latency mode. Valid values: `NORMAL`, `LOW`.
    63  	LatencyMode pulumi.StringOutput `pulumi:"latencyMode"`
    64  	// Channel name.
    65  	Name pulumi.StringOutput `pulumi:"name"`
    66  	// Channel playback URL.
    67  	PlaybackUrl pulumi.StringOutput `pulumi:"playbackUrl"`
    68  	// Recording configuration ARN.
    69  	RecordingConfigurationArn pulumi.StringOutput `pulumi:"recordingConfigurationArn"`
    70  	// 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.
    71  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    72  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    73  	//
    74  	// Deprecated: Please use `tags` instead.
    75  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    76  	// Channel type, which determines the allowable resolution and bitrate. Valid values: `STANDARD`, `BASIC`.
    77  	Type pulumi.StringOutput `pulumi:"type"`
    78  }
    79  
    80  // NewChannel registers a new resource with the given unique name, arguments, and options.
    81  func NewChannel(ctx *pulumi.Context,
    82  	name string, args *ChannelArgs, opts ...pulumi.ResourceOption) (*Channel, error) {
    83  	if args == nil {
    84  		args = &ChannelArgs{}
    85  	}
    86  
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource Channel
    89  	err := ctx.RegisterResource("aws:ivs/channel:Channel", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetChannel gets an existing Channel resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetChannel(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *ChannelState, opts ...pulumi.ResourceOption) (*Channel, error) {
   100  	var resource Channel
   101  	err := ctx.ReadResource("aws:ivs/channel:Channel", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering Channel resources.
   109  type channelState struct {
   110  	// ARN of the Channel.
   111  	Arn *string `pulumi:"arn"`
   112  	// If `true`, channel is private (enabled for playback authorization).
   113  	Authorized *bool `pulumi:"authorized"`
   114  	// Channel ingest endpoint, part of the definition of an ingest server, used when setting up streaming software.
   115  	IngestEndpoint *string `pulumi:"ingestEndpoint"`
   116  	// Channel latency mode. Valid values: `NORMAL`, `LOW`.
   117  	LatencyMode *string `pulumi:"latencyMode"`
   118  	// Channel name.
   119  	Name *string `pulumi:"name"`
   120  	// Channel playback URL.
   121  	PlaybackUrl *string `pulumi:"playbackUrl"`
   122  	// Recording configuration ARN.
   123  	RecordingConfigurationArn *string `pulumi:"recordingConfigurationArn"`
   124  	// 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.
   125  	Tags map[string]string `pulumi:"tags"`
   126  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   127  	//
   128  	// Deprecated: Please use `tags` instead.
   129  	TagsAll map[string]string `pulumi:"tagsAll"`
   130  	// Channel type, which determines the allowable resolution and bitrate. Valid values: `STANDARD`, `BASIC`.
   131  	Type *string `pulumi:"type"`
   132  }
   133  
   134  type ChannelState struct {
   135  	// ARN of the Channel.
   136  	Arn pulumi.StringPtrInput
   137  	// If `true`, channel is private (enabled for playback authorization).
   138  	Authorized pulumi.BoolPtrInput
   139  	// Channel ingest endpoint, part of the definition of an ingest server, used when setting up streaming software.
   140  	IngestEndpoint pulumi.StringPtrInput
   141  	// Channel latency mode. Valid values: `NORMAL`, `LOW`.
   142  	LatencyMode pulumi.StringPtrInput
   143  	// Channel name.
   144  	Name pulumi.StringPtrInput
   145  	// Channel playback URL.
   146  	PlaybackUrl pulumi.StringPtrInput
   147  	// Recording configuration ARN.
   148  	RecordingConfigurationArn pulumi.StringPtrInput
   149  	// 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.
   150  	Tags pulumi.StringMapInput
   151  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   152  	//
   153  	// Deprecated: Please use `tags` instead.
   154  	TagsAll pulumi.StringMapInput
   155  	// Channel type, which determines the allowable resolution and bitrate. Valid values: `STANDARD`, `BASIC`.
   156  	Type pulumi.StringPtrInput
   157  }
   158  
   159  func (ChannelState) ElementType() reflect.Type {
   160  	return reflect.TypeOf((*channelState)(nil)).Elem()
   161  }
   162  
   163  type channelArgs struct {
   164  	// If `true`, channel is private (enabled for playback authorization).
   165  	Authorized *bool `pulumi:"authorized"`
   166  	// Channel latency mode. Valid values: `NORMAL`, `LOW`.
   167  	LatencyMode *string `pulumi:"latencyMode"`
   168  	// Channel name.
   169  	Name *string `pulumi:"name"`
   170  	// Recording configuration ARN.
   171  	RecordingConfigurationArn *string `pulumi:"recordingConfigurationArn"`
   172  	// 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.
   173  	Tags map[string]string `pulumi:"tags"`
   174  	// Channel type, which determines the allowable resolution and bitrate. Valid values: `STANDARD`, `BASIC`.
   175  	Type *string `pulumi:"type"`
   176  }
   177  
   178  // The set of arguments for constructing a Channel resource.
   179  type ChannelArgs struct {
   180  	// If `true`, channel is private (enabled for playback authorization).
   181  	Authorized pulumi.BoolPtrInput
   182  	// Channel latency mode. Valid values: `NORMAL`, `LOW`.
   183  	LatencyMode pulumi.StringPtrInput
   184  	// Channel name.
   185  	Name pulumi.StringPtrInput
   186  	// Recording configuration ARN.
   187  	RecordingConfigurationArn pulumi.StringPtrInput
   188  	// 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.
   189  	Tags pulumi.StringMapInput
   190  	// Channel type, which determines the allowable resolution and bitrate. Valid values: `STANDARD`, `BASIC`.
   191  	Type pulumi.StringPtrInput
   192  }
   193  
   194  func (ChannelArgs) ElementType() reflect.Type {
   195  	return reflect.TypeOf((*channelArgs)(nil)).Elem()
   196  }
   197  
   198  type ChannelInput interface {
   199  	pulumi.Input
   200  
   201  	ToChannelOutput() ChannelOutput
   202  	ToChannelOutputWithContext(ctx context.Context) ChannelOutput
   203  }
   204  
   205  func (*Channel) ElementType() reflect.Type {
   206  	return reflect.TypeOf((**Channel)(nil)).Elem()
   207  }
   208  
   209  func (i *Channel) ToChannelOutput() ChannelOutput {
   210  	return i.ToChannelOutputWithContext(context.Background())
   211  }
   212  
   213  func (i *Channel) ToChannelOutputWithContext(ctx context.Context) ChannelOutput {
   214  	return pulumi.ToOutputWithContext(ctx, i).(ChannelOutput)
   215  }
   216  
   217  // ChannelArrayInput is an input type that accepts ChannelArray and ChannelArrayOutput values.
   218  // You can construct a concrete instance of `ChannelArrayInput` via:
   219  //
   220  //	ChannelArray{ ChannelArgs{...} }
   221  type ChannelArrayInput interface {
   222  	pulumi.Input
   223  
   224  	ToChannelArrayOutput() ChannelArrayOutput
   225  	ToChannelArrayOutputWithContext(context.Context) ChannelArrayOutput
   226  }
   227  
   228  type ChannelArray []ChannelInput
   229  
   230  func (ChannelArray) ElementType() reflect.Type {
   231  	return reflect.TypeOf((*[]*Channel)(nil)).Elem()
   232  }
   233  
   234  func (i ChannelArray) ToChannelArrayOutput() ChannelArrayOutput {
   235  	return i.ToChannelArrayOutputWithContext(context.Background())
   236  }
   237  
   238  func (i ChannelArray) ToChannelArrayOutputWithContext(ctx context.Context) ChannelArrayOutput {
   239  	return pulumi.ToOutputWithContext(ctx, i).(ChannelArrayOutput)
   240  }
   241  
   242  // ChannelMapInput is an input type that accepts ChannelMap and ChannelMapOutput values.
   243  // You can construct a concrete instance of `ChannelMapInput` via:
   244  //
   245  //	ChannelMap{ "key": ChannelArgs{...} }
   246  type ChannelMapInput interface {
   247  	pulumi.Input
   248  
   249  	ToChannelMapOutput() ChannelMapOutput
   250  	ToChannelMapOutputWithContext(context.Context) ChannelMapOutput
   251  }
   252  
   253  type ChannelMap map[string]ChannelInput
   254  
   255  func (ChannelMap) ElementType() reflect.Type {
   256  	return reflect.TypeOf((*map[string]*Channel)(nil)).Elem()
   257  }
   258  
   259  func (i ChannelMap) ToChannelMapOutput() ChannelMapOutput {
   260  	return i.ToChannelMapOutputWithContext(context.Background())
   261  }
   262  
   263  func (i ChannelMap) ToChannelMapOutputWithContext(ctx context.Context) ChannelMapOutput {
   264  	return pulumi.ToOutputWithContext(ctx, i).(ChannelMapOutput)
   265  }
   266  
   267  type ChannelOutput struct{ *pulumi.OutputState }
   268  
   269  func (ChannelOutput) ElementType() reflect.Type {
   270  	return reflect.TypeOf((**Channel)(nil)).Elem()
   271  }
   272  
   273  func (o ChannelOutput) ToChannelOutput() ChannelOutput {
   274  	return o
   275  }
   276  
   277  func (o ChannelOutput) ToChannelOutputWithContext(ctx context.Context) ChannelOutput {
   278  	return o
   279  }
   280  
   281  // ARN of the Channel.
   282  func (o ChannelOutput) Arn() pulumi.StringOutput {
   283  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   284  }
   285  
   286  // If `true`, channel is private (enabled for playback authorization).
   287  func (o ChannelOutput) Authorized() pulumi.BoolOutput {
   288  	return o.ApplyT(func(v *Channel) pulumi.BoolOutput { return v.Authorized }).(pulumi.BoolOutput)
   289  }
   290  
   291  // Channel ingest endpoint, part of the definition of an ingest server, used when setting up streaming software.
   292  func (o ChannelOutput) IngestEndpoint() pulumi.StringOutput {
   293  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.IngestEndpoint }).(pulumi.StringOutput)
   294  }
   295  
   296  // Channel latency mode. Valid values: `NORMAL`, `LOW`.
   297  func (o ChannelOutput) LatencyMode() pulumi.StringOutput {
   298  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.LatencyMode }).(pulumi.StringOutput)
   299  }
   300  
   301  // Channel name.
   302  func (o ChannelOutput) Name() pulumi.StringOutput {
   303  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   304  }
   305  
   306  // Channel playback URL.
   307  func (o ChannelOutput) PlaybackUrl() pulumi.StringOutput {
   308  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.PlaybackUrl }).(pulumi.StringOutput)
   309  }
   310  
   311  // Recording configuration ARN.
   312  func (o ChannelOutput) RecordingConfigurationArn() pulumi.StringOutput {
   313  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.RecordingConfigurationArn }).(pulumi.StringOutput)
   314  }
   315  
   316  // 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.
   317  func (o ChannelOutput) Tags() pulumi.StringMapOutput {
   318  	return o.ApplyT(func(v *Channel) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   319  }
   320  
   321  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   322  //
   323  // Deprecated: Please use `tags` instead.
   324  func (o ChannelOutput) TagsAll() pulumi.StringMapOutput {
   325  	return o.ApplyT(func(v *Channel) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   326  }
   327  
   328  // Channel type, which determines the allowable resolution and bitrate. Valid values: `STANDARD`, `BASIC`.
   329  func (o ChannelOutput) Type() pulumi.StringOutput {
   330  	return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
   331  }
   332  
   333  type ChannelArrayOutput struct{ *pulumi.OutputState }
   334  
   335  func (ChannelArrayOutput) ElementType() reflect.Type {
   336  	return reflect.TypeOf((*[]*Channel)(nil)).Elem()
   337  }
   338  
   339  func (o ChannelArrayOutput) ToChannelArrayOutput() ChannelArrayOutput {
   340  	return o
   341  }
   342  
   343  func (o ChannelArrayOutput) ToChannelArrayOutputWithContext(ctx context.Context) ChannelArrayOutput {
   344  	return o
   345  }
   346  
   347  func (o ChannelArrayOutput) Index(i pulumi.IntInput) ChannelOutput {
   348  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Channel {
   349  		return vs[0].([]*Channel)[vs[1].(int)]
   350  	}).(ChannelOutput)
   351  }
   352  
   353  type ChannelMapOutput struct{ *pulumi.OutputState }
   354  
   355  func (ChannelMapOutput) ElementType() reflect.Type {
   356  	return reflect.TypeOf((*map[string]*Channel)(nil)).Elem()
   357  }
   358  
   359  func (o ChannelMapOutput) ToChannelMapOutput() ChannelMapOutput {
   360  	return o
   361  }
   362  
   363  func (o ChannelMapOutput) ToChannelMapOutputWithContext(ctx context.Context) ChannelMapOutput {
   364  	return o
   365  }
   366  
   367  func (o ChannelMapOutput) MapIndex(k pulumi.StringInput) ChannelOutput {
   368  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Channel {
   369  		return vs[0].(map[string]*Channel)[vs[1].(string)]
   370  	}).(ChannelOutput)
   371  }
   372  
   373  func init() {
   374  	pulumi.RegisterInputType(reflect.TypeOf((*ChannelInput)(nil)).Elem(), &Channel{})
   375  	pulumi.RegisterInputType(reflect.TypeOf((*ChannelArrayInput)(nil)).Elem(), ChannelArray{})
   376  	pulumi.RegisterInputType(reflect.TypeOf((*ChannelMapInput)(nil)).Elem(), ChannelMap{})
   377  	pulumi.RegisterOutputType(ChannelOutput{})
   378  	pulumi.RegisterOutputType(ChannelArrayOutput{})
   379  	pulumi.RegisterOutputType(ChannelMapOutput{})
   380  }