diff --git a/integrations/terraform/go.mod b/integrations/terraform/go.mod index 8c9986b753d7b..42cac8463f60c 100644 --- a/integrations/terraform/go.mod +++ b/integrations/terraform/go.mod @@ -18,6 +18,7 @@ require ( github.com/gravitational/trace v1.4.0 github.com/hashicorp/terraform-plugin-framework v0.10.0 github.com/hashicorp/terraform-plugin-go v0.18.0 + github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 github.com/jonboulle/clockwork v0.4.0 github.com/sirupsen/logrus v1.9.3 @@ -26,8 +27,6 @@ require ( google.golang.org/protobuf v1.34.2 ) -require github.com/hashicorp/terraform-plugin-log v0.9.0 - require ( cloud.google.com/go v0.112.2 // indirect cloud.google.com/go/auth v0.3.0 // indirect diff --git a/integrations/terraform/provider/credentials.go b/integrations/terraform/provider/credentials.go index 0e6a26804ad65..e38eab6233c7e 100644 --- a/integrations/terraform/provider/credentials.go +++ b/integrations/terraform/provider/credentials.go @@ -126,7 +126,7 @@ func (s CredentialSources) BuildClient(ctx context.Context, clientCfg client.Con } now := time.Now() - if expiry, ok := creds.Expiry(); ok && !expiry.IsZero() && expiry.Before(now) { + if expiry, ok := client.Expiry(creds); ok && !expiry.IsZero() && expiry.Before(now) { diags.AddWarning( fmt.Sprintf("Teleport credentials %s are expired", source.Name()), fmt.Sprintf(`The credentials %s are expired. Expiration is %q while current time is %q). You might need to refresh them. The provider will not attempt to use those credentials.`,