Skip to content

Commit

Permalink
Merge branch 'cretueusebiu-issues-695'
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad committed Jul 14, 2020
2 parents 0f3f9b6 + ce138a5 commit a3bee06
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws/resource_aws_elastic_transcoder_preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func resourceAwsElasticTranscoderPreset() *schema.Resource {
"max_frame_rate": {
Type: schema.TypeString,
Optional: true,
Default: "30",
Computed: true,
ForceNew: true,
},
"max_height": {
Expand Down
66 changes: 66 additions & 0 deletions aws/resource_aws_elastic_transcoder_preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
7 changes: 7 additions & 0 deletions website/docs/guides/version-3-upgrade.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a3bee06

Please sign in to comment.