github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/mediapackage/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 mediapackage 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 AWS Elemental MediaPackage Channel. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/mediapackage" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := mediapackage.NewChannel(ctx, "kittens", &mediapackage.ChannelArgs{ 33 // ChannelId: pulumi.String("kitten-channel"), 34 // Description: pulumi.String("A channel dedicated to amusing videos of kittens."), 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 Media Package Channels using the channel ID. For example: 49 // 50 // ```sh 51 // $ pulumi import aws:mediapackage/channel:Channel kittens kittens-channel 52 // ``` 53 type Channel struct { 54 pulumi.CustomResourceState 55 56 // The ARN of the channel 57 Arn pulumi.StringOutput `pulumi:"arn"` 58 // A unique identifier describing the channel 59 ChannelId pulumi.StringOutput `pulumi:"channelId"` 60 // A description of the channel 61 Description pulumi.StringOutput `pulumi:"description"` 62 // A single item list of HLS ingest information 63 HlsIngests ChannelHlsIngestArrayOutput `pulumi:"hlsIngests"` 64 // 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. 65 Tags pulumi.StringMapOutput `pulumi:"tags"` 66 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 67 // 68 // Deprecated: Please use `tags` instead. 69 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 70 } 71 72 // NewChannel registers a new resource with the given unique name, arguments, and options. 73 func NewChannel(ctx *pulumi.Context, 74 name string, args *ChannelArgs, opts ...pulumi.ResourceOption) (*Channel, error) { 75 if args == nil { 76 return nil, errors.New("missing one or more required arguments") 77 } 78 79 if args.ChannelId == nil { 80 return nil, errors.New("invalid value for required argument 'ChannelId'") 81 } 82 if args.Description == nil { 83 args.Description = pulumi.StringPtr("Managed by Pulumi") 84 } 85 opts = internal.PkgResourceDefaultOpts(opts) 86 var resource Channel 87 err := ctx.RegisterResource("aws:mediapackage/channel:Channel", name, args, &resource, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return &resource, nil 92 } 93 94 // GetChannel gets an existing Channel resource's state with the given name, ID, and optional 95 // state properties that are used to uniquely qualify the lookup (nil if not required). 96 func GetChannel(ctx *pulumi.Context, 97 name string, id pulumi.IDInput, state *ChannelState, opts ...pulumi.ResourceOption) (*Channel, error) { 98 var resource Channel 99 err := ctx.ReadResource("aws:mediapackage/channel:Channel", name, id, state, &resource, opts...) 100 if err != nil { 101 return nil, err 102 } 103 return &resource, nil 104 } 105 106 // Input properties used for looking up and filtering Channel resources. 107 type channelState struct { 108 // The ARN of the channel 109 Arn *string `pulumi:"arn"` 110 // A unique identifier describing the channel 111 ChannelId *string `pulumi:"channelId"` 112 // A description of the channel 113 Description *string `pulumi:"description"` 114 // A single item list of HLS ingest information 115 HlsIngests []ChannelHlsIngest `pulumi:"hlsIngests"` 116 // 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. 117 Tags map[string]string `pulumi:"tags"` 118 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 119 // 120 // Deprecated: Please use `tags` instead. 121 TagsAll map[string]string `pulumi:"tagsAll"` 122 } 123 124 type ChannelState struct { 125 // The ARN of the channel 126 Arn pulumi.StringPtrInput 127 // A unique identifier describing the channel 128 ChannelId pulumi.StringPtrInput 129 // A description of the channel 130 Description pulumi.StringPtrInput 131 // A single item list of HLS ingest information 132 HlsIngests ChannelHlsIngestArrayInput 133 // 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. 134 Tags pulumi.StringMapInput 135 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 136 // 137 // Deprecated: Please use `tags` instead. 138 TagsAll pulumi.StringMapInput 139 } 140 141 func (ChannelState) ElementType() reflect.Type { 142 return reflect.TypeOf((*channelState)(nil)).Elem() 143 } 144 145 type channelArgs struct { 146 // A unique identifier describing the channel 147 ChannelId string `pulumi:"channelId"` 148 // A description of the channel 149 Description *string `pulumi:"description"` 150 // 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. 151 Tags map[string]string `pulumi:"tags"` 152 } 153 154 // The set of arguments for constructing a Channel resource. 155 type ChannelArgs struct { 156 // A unique identifier describing the channel 157 ChannelId pulumi.StringInput 158 // A description of the channel 159 Description pulumi.StringPtrInput 160 // 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. 161 Tags pulumi.StringMapInput 162 } 163 164 func (ChannelArgs) ElementType() reflect.Type { 165 return reflect.TypeOf((*channelArgs)(nil)).Elem() 166 } 167 168 type ChannelInput interface { 169 pulumi.Input 170 171 ToChannelOutput() ChannelOutput 172 ToChannelOutputWithContext(ctx context.Context) ChannelOutput 173 } 174 175 func (*Channel) ElementType() reflect.Type { 176 return reflect.TypeOf((**Channel)(nil)).Elem() 177 } 178 179 func (i *Channel) ToChannelOutput() ChannelOutput { 180 return i.ToChannelOutputWithContext(context.Background()) 181 } 182 183 func (i *Channel) ToChannelOutputWithContext(ctx context.Context) ChannelOutput { 184 return pulumi.ToOutputWithContext(ctx, i).(ChannelOutput) 185 } 186 187 // ChannelArrayInput is an input type that accepts ChannelArray and ChannelArrayOutput values. 188 // You can construct a concrete instance of `ChannelArrayInput` via: 189 // 190 // ChannelArray{ ChannelArgs{...} } 191 type ChannelArrayInput interface { 192 pulumi.Input 193 194 ToChannelArrayOutput() ChannelArrayOutput 195 ToChannelArrayOutputWithContext(context.Context) ChannelArrayOutput 196 } 197 198 type ChannelArray []ChannelInput 199 200 func (ChannelArray) ElementType() reflect.Type { 201 return reflect.TypeOf((*[]*Channel)(nil)).Elem() 202 } 203 204 func (i ChannelArray) ToChannelArrayOutput() ChannelArrayOutput { 205 return i.ToChannelArrayOutputWithContext(context.Background()) 206 } 207 208 func (i ChannelArray) ToChannelArrayOutputWithContext(ctx context.Context) ChannelArrayOutput { 209 return pulumi.ToOutputWithContext(ctx, i).(ChannelArrayOutput) 210 } 211 212 // ChannelMapInput is an input type that accepts ChannelMap and ChannelMapOutput values. 213 // You can construct a concrete instance of `ChannelMapInput` via: 214 // 215 // ChannelMap{ "key": ChannelArgs{...} } 216 type ChannelMapInput interface { 217 pulumi.Input 218 219 ToChannelMapOutput() ChannelMapOutput 220 ToChannelMapOutputWithContext(context.Context) ChannelMapOutput 221 } 222 223 type ChannelMap map[string]ChannelInput 224 225 func (ChannelMap) ElementType() reflect.Type { 226 return reflect.TypeOf((*map[string]*Channel)(nil)).Elem() 227 } 228 229 func (i ChannelMap) ToChannelMapOutput() ChannelMapOutput { 230 return i.ToChannelMapOutputWithContext(context.Background()) 231 } 232 233 func (i ChannelMap) ToChannelMapOutputWithContext(ctx context.Context) ChannelMapOutput { 234 return pulumi.ToOutputWithContext(ctx, i).(ChannelMapOutput) 235 } 236 237 type ChannelOutput struct{ *pulumi.OutputState } 238 239 func (ChannelOutput) ElementType() reflect.Type { 240 return reflect.TypeOf((**Channel)(nil)).Elem() 241 } 242 243 func (o ChannelOutput) ToChannelOutput() ChannelOutput { 244 return o 245 } 246 247 func (o ChannelOutput) ToChannelOutputWithContext(ctx context.Context) ChannelOutput { 248 return o 249 } 250 251 // The ARN of the channel 252 func (o ChannelOutput) Arn() pulumi.StringOutput { 253 return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 254 } 255 256 // A unique identifier describing the channel 257 func (o ChannelOutput) ChannelId() pulumi.StringOutput { 258 return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.ChannelId }).(pulumi.StringOutput) 259 } 260 261 // A description of the channel 262 func (o ChannelOutput) Description() pulumi.StringOutput { 263 return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 264 } 265 266 // A single item list of HLS ingest information 267 func (o ChannelOutput) HlsIngests() ChannelHlsIngestArrayOutput { 268 return o.ApplyT(func(v *Channel) ChannelHlsIngestArrayOutput { return v.HlsIngests }).(ChannelHlsIngestArrayOutput) 269 } 270 271 // 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. 272 func (o ChannelOutput) Tags() pulumi.StringMapOutput { 273 return o.ApplyT(func(v *Channel) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 274 } 275 276 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 277 // 278 // Deprecated: Please use `tags` instead. 279 func (o ChannelOutput) TagsAll() pulumi.StringMapOutput { 280 return o.ApplyT(func(v *Channel) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 281 } 282 283 type ChannelArrayOutput struct{ *pulumi.OutputState } 284 285 func (ChannelArrayOutput) ElementType() reflect.Type { 286 return reflect.TypeOf((*[]*Channel)(nil)).Elem() 287 } 288 289 func (o ChannelArrayOutput) ToChannelArrayOutput() ChannelArrayOutput { 290 return o 291 } 292 293 func (o ChannelArrayOutput) ToChannelArrayOutputWithContext(ctx context.Context) ChannelArrayOutput { 294 return o 295 } 296 297 func (o ChannelArrayOutput) Index(i pulumi.IntInput) ChannelOutput { 298 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Channel { 299 return vs[0].([]*Channel)[vs[1].(int)] 300 }).(ChannelOutput) 301 } 302 303 type ChannelMapOutput struct{ *pulumi.OutputState } 304 305 func (ChannelMapOutput) ElementType() reflect.Type { 306 return reflect.TypeOf((*map[string]*Channel)(nil)).Elem() 307 } 308 309 func (o ChannelMapOutput) ToChannelMapOutput() ChannelMapOutput { 310 return o 311 } 312 313 func (o ChannelMapOutput) ToChannelMapOutputWithContext(ctx context.Context) ChannelMapOutput { 314 return o 315 } 316 317 func (o ChannelMapOutput) MapIndex(k pulumi.StringInput) ChannelOutput { 318 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Channel { 319 return vs[0].(map[string]*Channel)[vs[1].(string)] 320 }).(ChannelOutput) 321 } 322 323 func init() { 324 pulumi.RegisterInputType(reflect.TypeOf((*ChannelInput)(nil)).Elem(), &Channel{}) 325 pulumi.RegisterInputType(reflect.TypeOf((*ChannelArrayInput)(nil)).Elem(), ChannelArray{}) 326 pulumi.RegisterInputType(reflect.TypeOf((*ChannelMapInput)(nil)).Elem(), ChannelMap{}) 327 pulumi.RegisterOutputType(ChannelOutput{}) 328 pulumi.RegisterOutputType(ChannelArrayOutput{}) 329 pulumi.RegisterOutputType(ChannelMapOutput{}) 330 }