From f241a1b72ab10a3e7c6934f0c6c6b95f95c5b612 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 9 Feb 2022 14:29:47 -0500 Subject: [PATCH 1/9] provider: add assume_role.0.duration and deprecate assume_role.0.duration_seconds --- internal/provider/provider.go | 22 +++++++++++--- internal/verify/validate.go | 11 +++++++ internal/verify/validate_test.go | 52 ++++++++++++++++++++++++++++++++ website/docs/index.html.markdown | 3 +- 4 files changed, 83 insertions(+), 5 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index a242f5d2df6..9f3fcb44592 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -1936,11 +1936,20 @@ func assumeRoleSchema() *schema.Schema { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "duration": { + Type: schema.TypeString, + Optional: true, + Description: "The duration of the role session, e.g. 1h. Valid time units are ns, us (or µs), ms, s, h, or m.", + ValidateFunc: verify.ValidTimeDuration, + ConflictsWith: []string{"assume_role.0.duration_seconds"}, + }, "duration_seconds": { - Type: schema.TypeInt, - Optional: true, - Description: "The duration, in seconds, of the role session.", - ValidateFunc: validation.IntBetween(900, 43200), + Type: schema.TypeInt, + Optional: true, + Deprecated: "Use assume_role.0.duration instead", + Description: "The duration, in seconds, of the role session.", + ValidateFunc: validation.IntBetween(900, 43200), + ConflictsWith: []string{"assume_role.0.duration"}, }, "external_id": { Type: schema.TypeString, @@ -2022,6 +2031,11 @@ func endpointsSchema() *schema.Schema { func expandAssumeRole(m map[string]interface{}) *awsbase.AssumeRole { assumeRole := awsbase.AssumeRole{} + if v, ok := m["duration"].(string); ok && v != "" { + duration, _ := time.ParseDuration(v) + assumeRole.Duration = duration + } + if v, ok := m["duration_seconds"].(int); ok && v != 0 { assumeRole.Duration = time.Duration(v) * time.Second } diff --git a/internal/verify/validate.go b/internal/verify/validate.go index b85c51f9b46..7a5185aa036 100644 --- a/internal/verify/validate.go +++ b/internal/verify/validate.go @@ -257,6 +257,17 @@ func ValidStringIsJSONOrYAML(v interface{}, k string) (ws []string, errors []err return } +// ValidTimeDuration validates a string can be parsed as a valid time.Duration +func ValidTimeDuration(v interface{}, k string) (ws []string, errors []error) { + _, err := time.ParseDuration(v.(string)) + + if err != nil { + errors = append(errors, fmt.Errorf("%q cannot be parsed as a valid time.Duration: %w", k, err)) + } + + return +} + // ValidTypeStringNullableBoolean provides custom error messaging for TypeString booleans // Some arguments require three values: true, false, and "" (unspecified). // This ValidateFunc returns a custom message since the message with diff --git a/internal/verify/validate_test.go b/internal/verify/validate_test.go index 791633b8654..de9312bb4ab 100644 --- a/internal/verify/validate_test.go +++ b/internal/verify/validate_test.go @@ -6,6 +6,58 @@ import ( "testing" ) +func TestValidTimeDuration(t *testing.T) { + testCases := []struct { + val interface{} + expectedErr *regexp.Regexp + }{ + { + val: "", + expectedErr: regexp.MustCompile(`cannot be parsed as a valid time.Duration`), + }, + { + val: "1", + expectedErr: regexp.MustCompile(`cannot be parsed as a valid time.Duration`), + }, + { + val: "-10h", + }, + { + val: "10h", + }, + { + val: "1h10m10s", + }, + } + + matchErr := func(errs []error, r *regexp.Regexp) bool { + // err must match one provided + for _, err := range errs { + if r.MatchString(err.Error()) { + return true + } + } + + return false + } + + for i, tc := range testCases { + _, errs := ValidTimeDuration(tc.val, "test_property") + + if len(errs) == 0 && tc.expectedErr == nil { + continue + } + + if len(errs) != 0 && tc.expectedErr == nil { + t.Fatalf("expected test case %d to produce no errors, got %v", i, errs) + } + + if !matchErr(errs, tc.expectedErr) { + t.Fatalf("expected test case %d to produce error matching \"%s\", got %v", i, tc.expectedErr, errs) + } + } +} + func TestValidTypeStringNullableBoolean(t *testing.T) { testCases := []struct { val interface{} diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 8d3995ae943..a036ab8d3f0 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -335,7 +335,8 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf The `assume_role` configuration block supports the following optional arguments: -* `duration_seconds` - (Optional) Number of seconds to restrict the assume role session duration. You can provide a value from 900 seconds (15 minutes) up to the maximum session duration setting for the role. +* `duration` - (Optional, Conflicts with `duration_seconds`) The assume role duration represented as a string such as `300ms`, `-1.5h` or `2h45m`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. +* `duration_seconds` - (Optional, **Deprecated** use `duration` instead) Number of seconds to restrict the assume role session duration. You can provide a value from 900 seconds (15 minutes) up to the maximum session duration setting for the role. * `external_id` - (Optional) External identifier to use when assuming the role. * `policy` - (Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. * `policy_arns` - (Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. From 378cf2f0d6cfe0803fcca302fc67c97a534f9d0f Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 9 Feb 2022 14:29:47 -0500 Subject: [PATCH 2/9] provider: add assume_role.0.duration and deprecate assume_role.0.duration_seconds --- internal/provider/provider.go | 22 +++++++++++--- internal/verify/validate.go | 11 +++++++ internal/verify/validate_test.go | 52 ++++++++++++++++++++++++++++++++ website/docs/index.html.markdown | 3 +- 4 files changed, 83 insertions(+), 5 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index a242f5d2df6..9f3fcb44592 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -1936,11 +1936,20 @@ func assumeRoleSchema() *schema.Schema { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "duration": { + Type: schema.TypeString, + Optional: true, + Description: "The duration of the role session, e.g. 1h. Valid time units are ns, us (or µs), ms, s, h, or m.", + ValidateFunc: verify.ValidTimeDuration, + ConflictsWith: []string{"assume_role.0.duration_seconds"}, + }, "duration_seconds": { - Type: schema.TypeInt, - Optional: true, - Description: "The duration, in seconds, of the role session.", - ValidateFunc: validation.IntBetween(900, 43200), + Type: schema.TypeInt, + Optional: true, + Deprecated: "Use assume_role.0.duration instead", + Description: "The duration, in seconds, of the role session.", + ValidateFunc: validation.IntBetween(900, 43200), + ConflictsWith: []string{"assume_role.0.duration"}, }, "external_id": { Type: schema.TypeString, @@ -2022,6 +2031,11 @@ func endpointsSchema() *schema.Schema { func expandAssumeRole(m map[string]interface{}) *awsbase.AssumeRole { assumeRole := awsbase.AssumeRole{} + if v, ok := m["duration"].(string); ok && v != "" { + duration, _ := time.ParseDuration(v) + assumeRole.Duration = duration + } + if v, ok := m["duration_seconds"].(int); ok && v != 0 { assumeRole.Duration = time.Duration(v) * time.Second } diff --git a/internal/verify/validate.go b/internal/verify/validate.go index b85c51f9b46..7a5185aa036 100644 --- a/internal/verify/validate.go +++ b/internal/verify/validate.go @@ -257,6 +257,17 @@ func ValidStringIsJSONOrYAML(v interface{}, k string) (ws []string, errors []err return } +// ValidTimeDuration validates a string can be parsed as a valid time.Duration +func ValidTimeDuration(v interface{}, k string) (ws []string, errors []error) { + _, err := time.ParseDuration(v.(string)) + + if err != nil { + errors = append(errors, fmt.Errorf("%q cannot be parsed as a valid time.Duration: %w", k, err)) + } + + return +} + // ValidTypeStringNullableBoolean provides custom error messaging for TypeString booleans // Some arguments require three values: true, false, and "" (unspecified). // This ValidateFunc returns a custom message since the message with diff --git a/internal/verify/validate_test.go b/internal/verify/validate_test.go index 791633b8654..de9312bb4ab 100644 --- a/internal/verify/validate_test.go +++ b/internal/verify/validate_test.go @@ -6,6 +6,58 @@ import ( "testing" ) +func TestValidTimeDuration(t *testing.T) { + testCases := []struct { + val interface{} + expectedErr *regexp.Regexp + }{ + { + val: "", + expectedErr: regexp.MustCompile(`cannot be parsed as a valid time.Duration`), + }, + { + val: "1", + expectedErr: regexp.MustCompile(`cannot be parsed as a valid time.Duration`), + }, + { + val: "-10h", + }, + { + val: "10h", + }, + { + val: "1h10m10s", + }, + } + + matchErr := func(errs []error, r *regexp.Regexp) bool { + // err must match one provided + for _, err := range errs { + if r.MatchString(err.Error()) { + return true + } + } + + return false + } + + for i, tc := range testCases { + _, errs := ValidTimeDuration(tc.val, "test_property") + + if len(errs) == 0 && tc.expectedErr == nil { + continue + } + + if len(errs) != 0 && tc.expectedErr == nil { + t.Fatalf("expected test case %d to produce no errors, got %v", i, errs) + } + + if !matchErr(errs, tc.expectedErr) { + t.Fatalf("expected test case %d to produce error matching \"%s\", got %v", i, tc.expectedErr, errs) + } + } +} + func TestValidTypeStringNullableBoolean(t *testing.T) { testCases := []struct { val interface{} diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 8d3995ae943..a036ab8d3f0 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -335,7 +335,8 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf The `assume_role` configuration block supports the following optional arguments: -* `duration_seconds` - (Optional) Number of seconds to restrict the assume role session duration. You can provide a value from 900 seconds (15 minutes) up to the maximum session duration setting for the role. +* `duration` - (Optional, Conflicts with `duration_seconds`) The assume role duration represented as a string such as `300ms`, `-1.5h` or `2h45m`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. +* `duration_seconds` - (Optional, **Deprecated** use `duration` instead) Number of seconds to restrict the assume role session duration. You can provide a value from 900 seconds (15 minutes) up to the maximum session duration setting for the role. * `external_id` - (Optional) External identifier to use when assuming the role. * `policy` - (Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. * `policy_arns` - (Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. From be67e1d4d5c74029b1a7c01f4f522b62eacfba0d Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 9 Feb 2022 14:51:49 -0500 Subject: [PATCH 3/9] Update CHANGELOG for #23077 --- .changelog/23077.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/23077.txt diff --git a/.changelog/23077.txt b/.changelog/23077.txt new file mode 100644 index 00000000000..e69eac04d16 --- /dev/null +++ b/.changelog/23077.txt @@ -0,0 +1,7 @@ +```release-note:note +provider: The `assume_role.0.duration_seconds` argument has been deprecated. All configurations using `assume_role.0.duration_seconds` should be updated to use the new `assume_role.0.duration` argument instead. +``` + +```release-note:enhancement +provider: Add `duration` argument to the `assume_role` configuration block +``` \ No newline at end of file From 4246ecca1246b9efaeace4fdf9672a3d08807a64 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 9 Feb 2022 15:01:40 -0500 Subject: [PATCH 4/9] add instructions for provider changes in #23007 --- website/docs/guides/version-4-upgrade.html.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/guides/version-4-upgrade.html.md b/website/docs/guides/version-4-upgrade.html.md index 71ecfc9dce7..bfb72ea144a 100644 --- a/website/docs/guides/version-4-upgrade.html.md +++ b/website/docs/guides/version-4-upgrade.html.md @@ -99,6 +99,7 @@ provider "aws" { Version 4.0.0 adds these new provider arguments: +* `assume_role.0.duration` - The assume role duration represented as a string e.g. `"1h"` or `"1h30s"`. Replaces `assume_role.0.duration_seconds`, which has been deprecated in Terraform AWS Provider v4.0.0 and support will be removed in a future version. * `ec2_metadata_service_endpoint` - Address of the EC2 metadata service (IMDS) endpoint to use. Can also be set with the `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. * `ec2_metadata_service_endpoint_mode` - Mode to use in communicating with the metadata service. Valid values are `IPv4` and `IPv6`. Can also be set with the `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment variable. * `s3_use_path_style` - Replaces `s3_force_path_style`, which has been deprecated in Terraform AWS Provider v4.0.0 and support will be removed in a future version. From ffae2f6397e02d4f83a58ff5851972a948e8da16 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Wed, 9 Feb 2022 17:04:22 -0500 Subject: [PATCH 5/9] Update duration description in website/docs/index.html.markdown Co-authored-by: Graham Davison --- website/docs/index.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index a036ab8d3f0..2bc19bbb0ae 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -335,7 +335,7 @@ In addition to [generic `provider` arguments](https://www.terraform.io/docs/conf The `assume_role` configuration block supports the following optional arguments: -* `duration` - (Optional, Conflicts with `duration_seconds`) The assume role duration represented as a string such as `300ms`, `-1.5h` or `2h45m`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. +* `duration` - (Optional, Conflicts with `duration_seconds`) Duration of the assume role session. You can provide a value from 15 minutes up to the maximum session duration setting for the role. Represented by a string such as `1h`, `2h45m`, or `30m15s`. * `duration_seconds` - (Optional, **Deprecated** use `duration` instead) Number of seconds to restrict the assume role session duration. You can provide a value from 900 seconds (15 minutes) up to the maximum session duration setting for the role. * `external_id` - (Optional) External identifier to use when assuming the role. * `policy` - (Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. From f06bef34bdff152a1254634a0da8cbf6f6b71592 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Wed, 9 Feb 2022 17:04:45 -0500 Subject: [PATCH 6/9] Update website/docs/guides/version-4-upgrade.html.md Co-authored-by: Graham Davison --- website/docs/guides/version-4-upgrade.html.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/guides/version-4-upgrade.html.md b/website/docs/guides/version-4-upgrade.html.md index bfb72ea144a..717bc7bf627 100644 --- a/website/docs/guides/version-4-upgrade.html.md +++ b/website/docs/guides/version-4-upgrade.html.md @@ -99,7 +99,7 @@ provider "aws" { Version 4.0.0 adds these new provider arguments: -* `assume_role.0.duration` - The assume role duration represented as a string e.g. `"1h"` or `"1h30s"`. Replaces `assume_role.0.duration_seconds`, which has been deprecated in Terraform AWS Provider v4.0.0 and support will be removed in a future version. +* `assume_role.duration` - The assume role duration represented as a string e.g. `"1h"` or `"1h30s"`. Replaces `assume_role.duration_seconds`, which has been deprecated in Terraform AWS Provider v4.0.0 and support will be removed in a future version. * `ec2_metadata_service_endpoint` - Address of the EC2 metadata service (IMDS) endpoint to use. Can also be set with the `AWS_EC2_METADATA_SERVICE_ENDPOINT` environment variable. * `ec2_metadata_service_endpoint_mode` - Mode to use in communicating with the metadata service. Valid values are `IPv4` and `IPv6`. Can also be set with the `AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE` environment variable. * `s3_use_path_style` - Replaces `s3_force_path_style`, which has been deprecated in Terraform AWS Provider v4.0.0 and support will be removed in a future version. From 7efdac42935dedb3430f1e20815795e9a8beadc2 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Wed, 9 Feb 2022 17:05:02 -0500 Subject: [PATCH 7/9] Update internal/verify/validate.go Co-authored-by: Graham Davison --- internal/verify/validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/verify/validate.go b/internal/verify/validate.go index 7a5185aa036..c5a0f3fb615 100644 --- a/internal/verify/validate.go +++ b/internal/verify/validate.go @@ -262,7 +262,7 @@ func ValidTimeDuration(v interface{}, k string) (ws []string, errors []error) { _, err := time.ParseDuration(v.(string)) if err != nil { - errors = append(errors, fmt.Errorf("%q cannot be parsed as a valid time.Duration: %w", k, err)) + errors = append(errors, fmt.Errorf("%q cannot be parsed as a duration: %w", k, err)) } return From 1f82a5c9ae3bf8c4e677fd624630115e24949515 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 9 Feb 2022 17:34:31 -0500 Subject: [PATCH 8/9] update provider assume role duration validation to include min and max --- internal/provider/provider.go | 4 +- internal/provider/validate.go | 23 ++++++++++ internal/provider/validate_test.go | 68 ++++++++++++++++++++++++++++++ internal/verify/validate.go | 11 ----- internal/verify/validate_test.go | 52 ----------------------- 5 files changed, 93 insertions(+), 65 deletions(-) create mode 100644 internal/provider/validate.go create mode 100644 internal/provider/validate_test.go diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 9f3fcb44592..c12f6794084 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -1939,8 +1939,8 @@ func assumeRoleSchema() *schema.Schema { "duration": { Type: schema.TypeString, Optional: true, - Description: "The duration of the role session, e.g. 1h. Valid time units are ns, us (or µs), ms, s, h, or m.", - ValidateFunc: verify.ValidTimeDuration, + Description: "The duration, between 15 minutes and 12 hours, of the role session. Valid time units are ns, us (or µs), ms, s, h, or m.", + ValidateFunc: ValidAssumeRoleDuration, ConflictsWith: []string{"assume_role.0.duration_seconds"}, }, "duration_seconds": { diff --git a/internal/provider/validate.go b/internal/provider/validate.go new file mode 100644 index 00000000000..6bb96f68f10 --- /dev/null +++ b/internal/provider/validate.go @@ -0,0 +1,23 @@ +package provider + +import ( + "fmt" + "time" +) + +// ValidAssumeRoleDuration validates a string can be parsed as a valid time.Duration +// and is within a minimum of 15 minutes and maximum of 12 hours +func ValidAssumeRoleDuration(v interface{}, k string) (ws []string, errors []error) { + duration, err := time.ParseDuration(v.(string)) + + if err != nil { + errors = append(errors, fmt.Errorf("%q cannot be parsed as a duration: %w", k, err)) + return + } + + if duration.Minutes() < 15 || duration.Hours() > 12 { + errors = append(errors, fmt.Errorf("duration %q must be between 15 minutes (15m) and 12 hours (12h), inclusive", k)) + } + + return +} diff --git a/internal/provider/validate_test.go b/internal/provider/validate_test.go new file mode 100644 index 00000000000..03a21b22f8d --- /dev/null +++ b/internal/provider/validate_test.go @@ -0,0 +1,68 @@ +package provider + +import ( + "regexp" + "testing" +) + +func TestValidAssumeRoleDuration(t *testing.T) { + testCases := []struct { + val interface{} + expectedErr *regexp.Regexp + }{ + { + val: "", + expectedErr: regexp.MustCompile(`cannot be parsed as a duration`), + }, + { + val: "1", + expectedErr: regexp.MustCompile(`cannot be parsed as a duration`), + }, + { + val: "10m", + expectedErr: regexp.MustCompile(`must be between 15 minutes \(15m\) and 12 hours \(12h\)`), + }, + { + val: "12h30m", + expectedErr: regexp.MustCompile(`must be between 15 minutes \(15m\) and 12 hours \(12h\)`), + }, + { + + val: "15m", + }, + { + val: "1h10m10s", + }, + { + + val: "12h", + }, + } + + matchErr := func(errs []error, r *regexp.Regexp) bool { + // err must match one provided + for _, err := range errs { + if r.MatchString(err.Error()) { + return true + } + } + + return false + } + + for i, tc := range testCases { + _, errs := ValidAssumeRoleDuration(tc.val, "test_property") + + if len(errs) == 0 && tc.expectedErr == nil { + continue + } + + if len(errs) != 0 && tc.expectedErr == nil { + t.Fatalf("expected test case %d to produce no errors, got %v", i, errs) + } + + if !matchErr(errs, tc.expectedErr) { + t.Fatalf("expected test case %d to produce error matching \"%s\", got %v", i, tc.expectedErr, errs) + } + } +} diff --git a/internal/verify/validate.go b/internal/verify/validate.go index c5a0f3fb615..b85c51f9b46 100644 --- a/internal/verify/validate.go +++ b/internal/verify/validate.go @@ -257,17 +257,6 @@ func ValidStringIsJSONOrYAML(v interface{}, k string) (ws []string, errors []err return } -// ValidTimeDuration validates a string can be parsed as a valid time.Duration -func ValidTimeDuration(v interface{}, k string) (ws []string, errors []error) { - _, err := time.ParseDuration(v.(string)) - - if err != nil { - errors = append(errors, fmt.Errorf("%q cannot be parsed as a duration: %w", k, err)) - } - - return -} - // ValidTypeStringNullableBoolean provides custom error messaging for TypeString booleans // Some arguments require three values: true, false, and "" (unspecified). // This ValidateFunc returns a custom message since the message with diff --git a/internal/verify/validate_test.go b/internal/verify/validate_test.go index 6458918e574..791633b8654 100644 --- a/internal/verify/validate_test.go +++ b/internal/verify/validate_test.go @@ -6,58 +6,6 @@ import ( "testing" ) -func TestValidTimeDuration(t *testing.T) { - testCases := []struct { - val interface{} - expectedErr *regexp.Regexp - }{ - { - val: "", - expectedErr: regexp.MustCompile(`cannot be parsed as a duration`), - }, - { - val: "1", - expectedErr: regexp.MustCompile(`cannot be parsed as a duration`), - }, - { - val: "-10h", - }, - { - val: "10h", - }, - { - val: "1h10m10s", - }, - } - - matchErr := func(errs []error, r *regexp.Regexp) bool { - // err must match one provided - for _, err := range errs { - if r.MatchString(err.Error()) { - return true - } - } - - return false - } - - for i, tc := range testCases { - _, errs := ValidTimeDuration(tc.val, "test_property") - - if len(errs) == 0 && tc.expectedErr == nil { - continue - } - - if len(errs) != 0 && tc.expectedErr == nil { - t.Fatalf("expected test case %d to produce no errors, got %v", i, errs) - } - - if !matchErr(errs, tc.expectedErr) { - t.Fatalf("expected test case %d to produce error matching \"%s\", got %v", i, tc.expectedErr, errs) - } - } -} - func TestValidTypeStringNullableBoolean(t *testing.T) { testCases := []struct { val interface{} From 5645b426eb8908f313e7bcf39bbbf6f923ea10a7 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Wed, 9 Feb 2022 19:11:43 -0500 Subject: [PATCH 9/9] Update 23077.txt --- .changelog/23077.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/23077.txt b/.changelog/23077.txt index e69eac04d16..7a1206a93e4 100644 --- a/.changelog/23077.txt +++ b/.changelog/23077.txt @@ -1,7 +1,7 @@ ```release-note:note -provider: The `assume_role.0.duration_seconds` argument has been deprecated. All configurations using `assume_role.0.duration_seconds` should be updated to use the new `assume_role.0.duration` argument instead. +provider: The `assume_role.duration_seconds` argument has been deprecated. All configurations using `assume_role.duration_seconds` should be updated to use the new `assume_role.duration` argument instead. ``` ```release-note:enhancement provider: Add `duration` argument to the `assume_role` configuration block -``` \ No newline at end of file +```