github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elastictranscoder/preset.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 elastictranscoder 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 Elastic Transcoder preset resource. 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/elastictranscoder" 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 := elastictranscoder.NewPreset(ctx, "bar", &elastictranscoder.PresetArgs{ 33 // Container: pulumi.String("mp4"), 34 // Description: pulumi.String("Sample Preset"), 35 // Name: pulumi.String("sample_preset"), 36 // Audio: &elastictranscoder.PresetAudioArgs{ 37 // AudioPackingMode: pulumi.String("SingleTrack"), 38 // BitRate: pulumi.String("96"), 39 // Channels: pulumi.String("2"), 40 // Codec: pulumi.String("AAC"), 41 // SampleRate: pulumi.String("44100"), 42 // }, 43 // AudioCodecOptions: &elastictranscoder.PresetAudioCodecOptionsArgs{ 44 // Profile: pulumi.String("AAC-LC"), 45 // }, 46 // Video: &elastictranscoder.PresetVideoArgs{ 47 // BitRate: pulumi.String("1600"), 48 // Codec: pulumi.String("H.264"), 49 // DisplayAspectRatio: pulumi.String("16:9"), 50 // FixedGop: pulumi.String("false"), 51 // FrameRate: pulumi.String("auto"), 52 // MaxFrameRate: pulumi.String("60"), 53 // KeyframesMaxDist: pulumi.String("240"), 54 // MaxHeight: pulumi.String("auto"), 55 // MaxWidth: pulumi.String("auto"), 56 // PaddingPolicy: pulumi.String("Pad"), 57 // SizingPolicy: pulumi.String("Fit"), 58 // }, 59 // VideoCodecOptions: pulumi.StringMap{ 60 // "Profile": pulumi.String("main"), 61 // "Level": pulumi.String("2.2"), 62 // "MaxReferenceFrames": pulumi.String("3"), 63 // "InterlacedMode": pulumi.String("Progressive"), 64 // "ColorSpaceConversionMode": pulumi.String("None"), 65 // }, 66 // VideoWatermarks: elastictranscoder.PresetVideoWatermarkArray{ 67 // &elastictranscoder.PresetVideoWatermarkArgs{ 68 // Id: pulumi.String("Test"), 69 // MaxWidth: pulumi.String("20%"), 70 // MaxHeight: pulumi.String("20%"), 71 // SizingPolicy: pulumi.String("ShrinkToFit"), 72 // HorizontalAlign: pulumi.String("Right"), 73 // HorizontalOffset: pulumi.String("10px"), 74 // VerticalAlign: pulumi.String("Bottom"), 75 // VerticalOffset: pulumi.String("10px"), 76 // Opacity: pulumi.String("55.5"), 77 // Target: pulumi.String("Content"), 78 // }, 79 // }, 80 // Thumbnails: &elastictranscoder.PresetThumbnailsArgs{ 81 // Format: pulumi.String("png"), 82 // Interval: pulumi.String("120"), 83 // MaxWidth: pulumi.String("auto"), 84 // MaxHeight: pulumi.String("auto"), 85 // PaddingPolicy: pulumi.String("Pad"), 86 // SizingPolicy: pulumi.String("Fit"), 87 // }, 88 // }) 89 // if err != nil { 90 // return err 91 // } 92 // return nil 93 // }) 94 // } 95 // 96 // ``` 97 // <!--End PulumiCodeChooser --> 98 // 99 // ## Import 100 // 101 // Using `pulumi import`, import Elastic Transcoder presets using the `id`. For example: 102 // 103 // ```sh 104 // $ pulumi import aws:elastictranscoder/preset:Preset basic_preset 1407981661351-cttk8b 105 // ``` 106 type Preset struct { 107 pulumi.CustomResourceState 108 109 // Amazon Resource Name (ARN) of the Elastic Transcoder Preset. 110 Arn pulumi.StringOutput `pulumi:"arn"` 111 // Audio parameters object (documented below). 112 Audio PresetAudioPtrOutput `pulumi:"audio"` 113 // Codec options for the audio parameters (documented below) 114 AudioCodecOptions PresetAudioCodecOptionsOutput `pulumi:"audioCodecOptions"` 115 // The container type for the output file. Valid values are `flac`, `flv`, `fmp4`, `gif`, `mp3`, `mp4`, `mpg`, `mxf`, `oga`, `ogg`, `ts`, and `webm`. 116 Container pulumi.StringOutput `pulumi:"container"` 117 // A description of the preset (maximum 255 characters) 118 Description pulumi.StringPtrOutput `pulumi:"description"` 119 // The name of the preset. (maximum 40 characters) 120 Name pulumi.StringOutput `pulumi:"name"` 121 // Thumbnail parameters object (documented below) 122 Thumbnails PresetThumbnailsPtrOutput `pulumi:"thumbnails"` 123 Type pulumi.StringOutput `pulumi:"type"` 124 // Video parameters object (documented below) 125 Video PresetVideoPtrOutput `pulumi:"video"` 126 // Codec options for the video parameters 127 VideoCodecOptions pulumi.StringMapOutput `pulumi:"videoCodecOptions"` 128 // Watermark parameters for the video parameters (documented below) 129 VideoWatermarks PresetVideoWatermarkArrayOutput `pulumi:"videoWatermarks"` 130 } 131 132 // NewPreset registers a new resource with the given unique name, arguments, and options. 133 func NewPreset(ctx *pulumi.Context, 134 name string, args *PresetArgs, opts ...pulumi.ResourceOption) (*Preset, error) { 135 if args == nil { 136 return nil, errors.New("missing one or more required arguments") 137 } 138 139 if args.Container == nil { 140 return nil, errors.New("invalid value for required argument 'Container'") 141 } 142 opts = internal.PkgResourceDefaultOpts(opts) 143 var resource Preset 144 err := ctx.RegisterResource("aws:elastictranscoder/preset:Preset", name, args, &resource, opts...) 145 if err != nil { 146 return nil, err 147 } 148 return &resource, nil 149 } 150 151 // GetPreset gets an existing Preset resource's state with the given name, ID, and optional 152 // state properties that are used to uniquely qualify the lookup (nil if not required). 153 func GetPreset(ctx *pulumi.Context, 154 name string, id pulumi.IDInput, state *PresetState, opts ...pulumi.ResourceOption) (*Preset, error) { 155 var resource Preset 156 err := ctx.ReadResource("aws:elastictranscoder/preset:Preset", name, id, state, &resource, opts...) 157 if err != nil { 158 return nil, err 159 } 160 return &resource, nil 161 } 162 163 // Input properties used for looking up and filtering Preset resources. 164 type presetState struct { 165 // Amazon Resource Name (ARN) of the Elastic Transcoder Preset. 166 Arn *string `pulumi:"arn"` 167 // Audio parameters object (documented below). 168 Audio *PresetAudio `pulumi:"audio"` 169 // Codec options for the audio parameters (documented below) 170 AudioCodecOptions *PresetAudioCodecOptions `pulumi:"audioCodecOptions"` 171 // The container type for the output file. Valid values are `flac`, `flv`, `fmp4`, `gif`, `mp3`, `mp4`, `mpg`, `mxf`, `oga`, `ogg`, `ts`, and `webm`. 172 Container *string `pulumi:"container"` 173 // A description of the preset (maximum 255 characters) 174 Description *string `pulumi:"description"` 175 // The name of the preset. (maximum 40 characters) 176 Name *string `pulumi:"name"` 177 // Thumbnail parameters object (documented below) 178 Thumbnails *PresetThumbnails `pulumi:"thumbnails"` 179 Type *string `pulumi:"type"` 180 // Video parameters object (documented below) 181 Video *PresetVideo `pulumi:"video"` 182 // Codec options for the video parameters 183 VideoCodecOptions map[string]string `pulumi:"videoCodecOptions"` 184 // Watermark parameters for the video parameters (documented below) 185 VideoWatermarks []PresetVideoWatermark `pulumi:"videoWatermarks"` 186 } 187 188 type PresetState struct { 189 // Amazon Resource Name (ARN) of the Elastic Transcoder Preset. 190 Arn pulumi.StringPtrInput 191 // Audio parameters object (documented below). 192 Audio PresetAudioPtrInput 193 // Codec options for the audio parameters (documented below) 194 AudioCodecOptions PresetAudioCodecOptionsPtrInput 195 // The container type for the output file. Valid values are `flac`, `flv`, `fmp4`, `gif`, `mp3`, `mp4`, `mpg`, `mxf`, `oga`, `ogg`, `ts`, and `webm`. 196 Container pulumi.StringPtrInput 197 // A description of the preset (maximum 255 characters) 198 Description pulumi.StringPtrInput 199 // The name of the preset. (maximum 40 characters) 200 Name pulumi.StringPtrInput 201 // Thumbnail parameters object (documented below) 202 Thumbnails PresetThumbnailsPtrInput 203 Type pulumi.StringPtrInput 204 // Video parameters object (documented below) 205 Video PresetVideoPtrInput 206 // Codec options for the video parameters 207 VideoCodecOptions pulumi.StringMapInput 208 // Watermark parameters for the video parameters (documented below) 209 VideoWatermarks PresetVideoWatermarkArrayInput 210 } 211 212 func (PresetState) ElementType() reflect.Type { 213 return reflect.TypeOf((*presetState)(nil)).Elem() 214 } 215 216 type presetArgs struct { 217 // Audio parameters object (documented below). 218 Audio *PresetAudio `pulumi:"audio"` 219 // Codec options for the audio parameters (documented below) 220 AudioCodecOptions *PresetAudioCodecOptions `pulumi:"audioCodecOptions"` 221 // The container type for the output file. Valid values are `flac`, `flv`, `fmp4`, `gif`, `mp3`, `mp4`, `mpg`, `mxf`, `oga`, `ogg`, `ts`, and `webm`. 222 Container string `pulumi:"container"` 223 // A description of the preset (maximum 255 characters) 224 Description *string `pulumi:"description"` 225 // The name of the preset. (maximum 40 characters) 226 Name *string `pulumi:"name"` 227 // Thumbnail parameters object (documented below) 228 Thumbnails *PresetThumbnails `pulumi:"thumbnails"` 229 Type *string `pulumi:"type"` 230 // Video parameters object (documented below) 231 Video *PresetVideo `pulumi:"video"` 232 // Codec options for the video parameters 233 VideoCodecOptions map[string]string `pulumi:"videoCodecOptions"` 234 // Watermark parameters for the video parameters (documented below) 235 VideoWatermarks []PresetVideoWatermark `pulumi:"videoWatermarks"` 236 } 237 238 // The set of arguments for constructing a Preset resource. 239 type PresetArgs struct { 240 // Audio parameters object (documented below). 241 Audio PresetAudioPtrInput 242 // Codec options for the audio parameters (documented below) 243 AudioCodecOptions PresetAudioCodecOptionsPtrInput 244 // The container type for the output file. Valid values are `flac`, `flv`, `fmp4`, `gif`, `mp3`, `mp4`, `mpg`, `mxf`, `oga`, `ogg`, `ts`, and `webm`. 245 Container pulumi.StringInput 246 // A description of the preset (maximum 255 characters) 247 Description pulumi.StringPtrInput 248 // The name of the preset. (maximum 40 characters) 249 Name pulumi.StringPtrInput 250 // Thumbnail parameters object (documented below) 251 Thumbnails PresetThumbnailsPtrInput 252 Type pulumi.StringPtrInput 253 // Video parameters object (documented below) 254 Video PresetVideoPtrInput 255 // Codec options for the video parameters 256 VideoCodecOptions pulumi.StringMapInput 257 // Watermark parameters for the video parameters (documented below) 258 VideoWatermarks PresetVideoWatermarkArrayInput 259 } 260 261 func (PresetArgs) ElementType() reflect.Type { 262 return reflect.TypeOf((*presetArgs)(nil)).Elem() 263 } 264 265 type PresetInput interface { 266 pulumi.Input 267 268 ToPresetOutput() PresetOutput 269 ToPresetOutputWithContext(ctx context.Context) PresetOutput 270 } 271 272 func (*Preset) ElementType() reflect.Type { 273 return reflect.TypeOf((**Preset)(nil)).Elem() 274 } 275 276 func (i *Preset) ToPresetOutput() PresetOutput { 277 return i.ToPresetOutputWithContext(context.Background()) 278 } 279 280 func (i *Preset) ToPresetOutputWithContext(ctx context.Context) PresetOutput { 281 return pulumi.ToOutputWithContext(ctx, i).(PresetOutput) 282 } 283 284 // PresetArrayInput is an input type that accepts PresetArray and PresetArrayOutput values. 285 // You can construct a concrete instance of `PresetArrayInput` via: 286 // 287 // PresetArray{ PresetArgs{...} } 288 type PresetArrayInput interface { 289 pulumi.Input 290 291 ToPresetArrayOutput() PresetArrayOutput 292 ToPresetArrayOutputWithContext(context.Context) PresetArrayOutput 293 } 294 295 type PresetArray []PresetInput 296 297 func (PresetArray) ElementType() reflect.Type { 298 return reflect.TypeOf((*[]*Preset)(nil)).Elem() 299 } 300 301 func (i PresetArray) ToPresetArrayOutput() PresetArrayOutput { 302 return i.ToPresetArrayOutputWithContext(context.Background()) 303 } 304 305 func (i PresetArray) ToPresetArrayOutputWithContext(ctx context.Context) PresetArrayOutput { 306 return pulumi.ToOutputWithContext(ctx, i).(PresetArrayOutput) 307 } 308 309 // PresetMapInput is an input type that accepts PresetMap and PresetMapOutput values. 310 // You can construct a concrete instance of `PresetMapInput` via: 311 // 312 // PresetMap{ "key": PresetArgs{...} } 313 type PresetMapInput interface { 314 pulumi.Input 315 316 ToPresetMapOutput() PresetMapOutput 317 ToPresetMapOutputWithContext(context.Context) PresetMapOutput 318 } 319 320 type PresetMap map[string]PresetInput 321 322 func (PresetMap) ElementType() reflect.Type { 323 return reflect.TypeOf((*map[string]*Preset)(nil)).Elem() 324 } 325 326 func (i PresetMap) ToPresetMapOutput() PresetMapOutput { 327 return i.ToPresetMapOutputWithContext(context.Background()) 328 } 329 330 func (i PresetMap) ToPresetMapOutputWithContext(ctx context.Context) PresetMapOutput { 331 return pulumi.ToOutputWithContext(ctx, i).(PresetMapOutput) 332 } 333 334 type PresetOutput struct{ *pulumi.OutputState } 335 336 func (PresetOutput) ElementType() reflect.Type { 337 return reflect.TypeOf((**Preset)(nil)).Elem() 338 } 339 340 func (o PresetOutput) ToPresetOutput() PresetOutput { 341 return o 342 } 343 344 func (o PresetOutput) ToPresetOutputWithContext(ctx context.Context) PresetOutput { 345 return o 346 } 347 348 // Amazon Resource Name (ARN) of the Elastic Transcoder Preset. 349 func (o PresetOutput) Arn() pulumi.StringOutput { 350 return o.ApplyT(func(v *Preset) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 351 } 352 353 // Audio parameters object (documented below). 354 func (o PresetOutput) Audio() PresetAudioPtrOutput { 355 return o.ApplyT(func(v *Preset) PresetAudioPtrOutput { return v.Audio }).(PresetAudioPtrOutput) 356 } 357 358 // Codec options for the audio parameters (documented below) 359 func (o PresetOutput) AudioCodecOptions() PresetAudioCodecOptionsOutput { 360 return o.ApplyT(func(v *Preset) PresetAudioCodecOptionsOutput { return v.AudioCodecOptions }).(PresetAudioCodecOptionsOutput) 361 } 362 363 // The container type for the output file. Valid values are `flac`, `flv`, `fmp4`, `gif`, `mp3`, `mp4`, `mpg`, `mxf`, `oga`, `ogg`, `ts`, and `webm`. 364 func (o PresetOutput) Container() pulumi.StringOutput { 365 return o.ApplyT(func(v *Preset) pulumi.StringOutput { return v.Container }).(pulumi.StringOutput) 366 } 367 368 // A description of the preset (maximum 255 characters) 369 func (o PresetOutput) Description() pulumi.StringPtrOutput { 370 return o.ApplyT(func(v *Preset) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 371 } 372 373 // The name of the preset. (maximum 40 characters) 374 func (o PresetOutput) Name() pulumi.StringOutput { 375 return o.ApplyT(func(v *Preset) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 376 } 377 378 // Thumbnail parameters object (documented below) 379 func (o PresetOutput) Thumbnails() PresetThumbnailsPtrOutput { 380 return o.ApplyT(func(v *Preset) PresetThumbnailsPtrOutput { return v.Thumbnails }).(PresetThumbnailsPtrOutput) 381 } 382 383 func (o PresetOutput) Type() pulumi.StringOutput { 384 return o.ApplyT(func(v *Preset) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) 385 } 386 387 // Video parameters object (documented below) 388 func (o PresetOutput) Video() PresetVideoPtrOutput { 389 return o.ApplyT(func(v *Preset) PresetVideoPtrOutput { return v.Video }).(PresetVideoPtrOutput) 390 } 391 392 // Codec options for the video parameters 393 func (o PresetOutput) VideoCodecOptions() pulumi.StringMapOutput { 394 return o.ApplyT(func(v *Preset) pulumi.StringMapOutput { return v.VideoCodecOptions }).(pulumi.StringMapOutput) 395 } 396 397 // Watermark parameters for the video parameters (documented below) 398 func (o PresetOutput) VideoWatermarks() PresetVideoWatermarkArrayOutput { 399 return o.ApplyT(func(v *Preset) PresetVideoWatermarkArrayOutput { return v.VideoWatermarks }).(PresetVideoWatermarkArrayOutput) 400 } 401 402 type PresetArrayOutput struct{ *pulumi.OutputState } 403 404 func (PresetArrayOutput) ElementType() reflect.Type { 405 return reflect.TypeOf((*[]*Preset)(nil)).Elem() 406 } 407 408 func (o PresetArrayOutput) ToPresetArrayOutput() PresetArrayOutput { 409 return o 410 } 411 412 func (o PresetArrayOutput) ToPresetArrayOutputWithContext(ctx context.Context) PresetArrayOutput { 413 return o 414 } 415 416 func (o PresetArrayOutput) Index(i pulumi.IntInput) PresetOutput { 417 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Preset { 418 return vs[0].([]*Preset)[vs[1].(int)] 419 }).(PresetOutput) 420 } 421 422 type PresetMapOutput struct{ *pulumi.OutputState } 423 424 func (PresetMapOutput) ElementType() reflect.Type { 425 return reflect.TypeOf((*map[string]*Preset)(nil)).Elem() 426 } 427 428 func (o PresetMapOutput) ToPresetMapOutput() PresetMapOutput { 429 return o 430 } 431 432 func (o PresetMapOutput) ToPresetMapOutputWithContext(ctx context.Context) PresetMapOutput { 433 return o 434 } 435 436 func (o PresetMapOutput) MapIndex(k pulumi.StringInput) PresetOutput { 437 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Preset { 438 return vs[0].(map[string]*Preset)[vs[1].(string)] 439 }).(PresetOutput) 440 } 441 442 func init() { 443 pulumi.RegisterInputType(reflect.TypeOf((*PresetInput)(nil)).Elem(), &Preset{}) 444 pulumi.RegisterInputType(reflect.TypeOf((*PresetArrayInput)(nil)).Elem(), PresetArray{}) 445 pulumi.RegisterInputType(reflect.TypeOf((*PresetMapInput)(nil)).Elem(), PresetMap{}) 446 pulumi.RegisterOutputType(PresetOutput{}) 447 pulumi.RegisterOutputType(PresetArrayOutput{}) 448 pulumi.RegisterOutputType(PresetMapOutput{}) 449 }