diff --git a/aws/resource_aws_elastic_transcoder_preset.go b/aws/resource_aws_elastic_transcoder_preset.go index dfe0777a36c..f3591f69401 100644 --- a/aws/resource_aws_elastic_transcoder_preset.go +++ b/aws/resource_aws_elastic_transcoder_preset.go @@ -215,7 +215,7 @@ func resourceAwsElasticTranscoderPreset() *schema.Resource { "max_frame_rate": { Type: schema.TypeString, Optional: true, - Default: "30", + Computed: true, ForceNew: true, }, "max_height": { diff --git a/aws/resource_aws_elastic_transcoder_preset_test.go b/aws/resource_aws_elastic_transcoder_preset_test.go index dc75fbdba55..80600fc5139 100644 --- a/aws/resource_aws_elastic_transcoder_preset_test.go +++ b/aws/resource_aws_elastic_transcoder_preset_test.go @@ -133,6 +133,33 @@ func TestAccAWSElasticTranscoderPreset_Full(t *testing.T) { }) } +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/695 +func TestAccAWSElasticTranscoderPreset_Video_FrameRate(t *testing.T) { + var preset elastictranscoder.Preset + resourceName := "aws_elastictranscoder_preset.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsElasticTranscoderPresetConfigVideoFrameRate(rName, "29.97"), + Check: resource.ComposeTestCheckFunc( + testAccCheckElasticTranscoderPresetExists(resourceName, &preset), + resource.TestCheckResourceAttr(resourceName, "video.0.frame_rate", "29.97"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckElasticTranscoderPresetExists(name string, preset *elastictranscoder.Preset) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).elastictranscoderconn @@ -346,3 +373,42 @@ resource "aws_elastictranscoder_preset" "test" { } `, rName) } + +func testAccAwsElasticTranscoderPresetConfigVideoFrameRate(rName string, frameRate string) string { + return fmt.Sprintf(` +resource "aws_elastictranscoder_preset" "test" { + container = "mp4" + name = %[1]q + + thumbnails { + format = "png" + interval = 120 + max_width = "auto" + max_height = "auto" + padding_policy = "Pad" + sizing_policy = "Fit" + } + + video { + bit_rate = "auto" + codec = "H.264" + display_aspect_ratio = "16:9" + fixed_gop = "true" + frame_rate = %[2]q + keyframes_max_dist = 90 + max_height = 1080 + max_width = 1920 + padding_policy = "Pad" + sizing_policy = "Fit" + } + + video_codec_options = { + Profile = "main" + Level = "4.1" + MaxReferenceFrames = 4 + InterlacedMode = "Auto" + ColorSpaceConversionMode = "None" + } +} +`, rName, frameRate) +} diff --git a/website/docs/guides/version-3-upgrade.html.md b/website/docs/guides/version-3-upgrade.html.md index c4fc375fbaf..c2fec8b3afe 100644 --- a/website/docs/guides/version-3-upgrade.html.md +++ b/website/docs/guides/version-3-upgrade.html.md @@ -21,6 +21,7 @@ Upgrade topics: - [Data Source: aws_availability_zones](#data-source-aws_availability_zones) - [Data Source: aws_lambda_invocation](#data-source-aws_lambda_invocation) - [Resource: aws_dx_gateway](#resource-aws_dx_gateway) +- [Resource: aws_elastic_transcoder_preset](#resource-aws_elastic_transcoder_preset) - [Resource: aws_emr_cluster](#resource-aws_emr_cluster) - [Resource: aws_lb_listener_rule](#resource-aws_lb_listener_rule) - [Resource: aws_s3_bucket](#resource-aws_s3_bucket) @@ -157,6 +158,12 @@ output "lambda_result" { Previously when importing the `aws_dx_gateway` resource with the [`terraform import` command](/docs/commands/import.html), the Terraform AWS Provider would automatically attempt to import an associated `aws_dx_gateway_association` resource(s) as well. This automatic resource import has been removed. Use the [`aws_dx_gateway_association` resource import](/docs/providers/aws/r/dx_gateway_association.html#import) to import those resources separately. +## Resource: aws_elastic_transcoder_preset + +### video Configuration Block max_frame_rate Argument No Longer Uses 30 Default + +Previously when the `max_frame_rate` argument was not configured, the resource would default to 30. This behavior has been removed and allows for auto frame rate presets to automatically set the appropriate value. + ## Resource: aws_emr_cluster ### core_instance_count Argument Removal