diff --git a/builtin/logical/aws/backend_test.go b/builtin/logical/aws/backend_test.go index da7749161990..bbc82d50da60 100644 --- a/builtin/logical/aws/backend_test.go +++ b/builtin/logical/aws/backend_test.go @@ -544,7 +544,7 @@ func testAccStepReadPolicy(t *testing.T, name string, value string) logicaltest. "role_arns": []string(nil), "policy_document": value, "credential_types": []string{iamUserCred, federationTokenCred}, - "default_sts_ttl": time.Duration(0), + "default_sts_ttl": int64(0), } if !reflect.DeepEqual(resp.Data, expected) { return fmt.Errorf("bad: got: %#v\nexpected: %#v", resp.Data, expected) @@ -639,7 +639,7 @@ func TestBackend_iamUserManagedInlinePolicies(t *testing.T) { "policy_arns": []string{ec2PolicyArn, iamPolicyArn}, "credential_types": []string{iamUserCred}, "role_arns": []string(nil), - "default_sts_ttl": time.Duration(0), + "default_sts_ttl": int64(0), } logicaltest.Test(t, logicaltest.TestCase{ AcceptanceTest: true, @@ -754,7 +754,7 @@ func testAccStepReadArnPolicy(t *testing.T, name string, value string) logicalte "role_arns": []string(nil), "policy_document": "", "credential_types": []string{iamUserCred}, - "default_sts_ttl": time.Duration(0), + "default_sts_ttl": int64(0), } if !reflect.DeepEqual(resp.Data, expected) { return fmt.Errorf("bad: got: %#v\nexpected: %#v", resp.Data, expected) diff --git a/builtin/logical/aws/path_roles.go b/builtin/logical/aws/path_roles.go index adeedac6d302..3df316ad6902 100644 --- a/builtin/logical/aws/path_roles.go +++ b/builtin/logical/aws/path_roles.go @@ -406,7 +406,7 @@ func (r *awsRoleEntry) toResponseData() map[string]interface{} { "policy_arns": r.PolicyArns, "role_arns": r.RoleArns, "policy_document": r.PolicyDocument, - "default_sts_ttl": r.DefaultSTSTTL / time.Second, + "default_sts_ttl": int64(r.DefaultSTSTTL.Seconds()), } if r.InvalidData != "" { respData["invalid_data"] = r.InvalidData diff --git a/builtin/logical/aws/path_user.go b/builtin/logical/aws/path_user.go index 86b9c71ef6b8..b12289e3ae57 100644 --- a/builtin/logical/aws/path_user.go +++ b/builtin/logical/aws/path_user.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" @@ -63,7 +62,7 @@ func (b *backend) pathCredsRead(ctx context.Context, req *logical.Request, d *fr case ok: ttl = int64(ttlRaw.(int)) case role.DefaultSTSTTL > 0: - ttl = int64(role.DefaultSTSTTL / time.Second) + ttl = int64(role.DefaultSTSTTL.Seconds()) default: ttl = int64(d.Get("ttl").(int)) }