From d6835defa6503358c24dbcb83cd4b7de1319fc2f Mon Sep 17 00:00:00 2001 From: rosstimothy <39066650+rosstimothy@users.noreply.github.com> Date: Tue, 5 Dec 2023 09:14:09 -0500 Subject: [PATCH] Terraform Provider: organize imports of generated code (#977) Updates code generation to sort and group imports in the same manner as dictated by the gci rules in the golanci-lint config. This also removes the redundant `tfschema` import alias for packages which do not have custom schema. --- terraform/gen/main.go | 20 +++++++++- terraform/gen/plural_data_source.go.tpl | 16 +++----- terraform/gen/plural_resource.go.tpl | 37 +++++++++---------- terraform/gen/singular_data_source.go.tpl | 10 ++--- terraform/gen/singular_resource.go.tpl | 10 ++--- .../data_source_teleport_access_list.go | 9 ++--- .../provider/data_source_teleport_app.go | 10 ++--- .../data_source_teleport_auth_preference.go | 6 +-- ...rce_teleport_cluster_maintenance_config.go | 6 +-- ...urce_teleport_cluster_networking_config.go | 6 +-- .../provider/data_source_teleport_database.go | 10 ++--- .../data_source_teleport_device_trust.go | 11 +++--- .../data_source_teleport_github_connector.go | 10 ++--- .../data_source_teleport_login_rule.go | 5 ++- .../data_source_teleport_oidc_connector.go | 10 ++--- .../data_source_teleport_okta_import_rule.go | 10 ++--- .../data_source_teleport_provision_token.go | 10 ++--- .../provider/data_source_teleport_role.go | 10 ++--- .../data_source_teleport_saml_connector.go | 10 ++--- ...ource_teleport_session_recording_config.go | 6 +-- .../data_source_teleport_trusted_cluster.go | 10 ++--- .../provider/data_source_teleport_user.go | 10 ++--- .../provider/resource_teleport_access_list.go | 12 +++--- terraform/provider/resource_teleport_app.go | 13 ++++--- .../resource_teleport_auth_preference.go | 10 ++--- ...rce_teleport_cluster_maintenance_config.go | 10 ++--- ...urce_teleport_cluster_networking_config.go | 10 ++--- .../provider/resource_teleport_database.go | 13 ++++--- .../resource_teleport_device_trust.go | 29 ++++++++------- .../resource_teleport_github_connector.go | 13 ++++--- .../provider/resource_teleport_login_rule.go | 11 +++--- .../resource_teleport_oidc_connector.go | 13 ++++--- .../resource_teleport_okta_import_rule.go | 13 ++++--- .../resource_teleport_provision_token.go | 17 +++++---- terraform/provider/resource_teleport_role.go | 13 ++++--- .../resource_teleport_saml_connector.go | 13 ++++--- ...ource_teleport_session_recording_config.go | 10 ++--- .../resource_teleport_trusted_cluster.go | 13 ++++--- terraform/provider/resource_teleport_user.go | 13 ++++--- 39 files changed, 247 insertions(+), 221 deletions(-) diff --git a/terraform/gen/main.go b/terraform/gen/main.go index 291c9aac1..71493fe56 100644 --- a/terraform/gen/main.go +++ b/terraform/gen/main.go @@ -373,6 +373,7 @@ var ( Kind: "device", ID: "trustedDevice.Metadata.Name", HasStaticID: true, + SchemaPackage: "schemav1", SchemaPackagePath: "github.com/gravitational/teleport-plugins/terraform/tfschema/devicetrust/v1", IsPlainStruct: true, UUIDMetadataName: true, @@ -477,7 +478,24 @@ func generate(p payload, tpl, outFile string) { log.Fatal(err) } - t, err := template.ParseFiles(path.Join("gen", tpl)) + funcs := template.FuncMap{ + "schemaImport": func(p payload) string { + if p.SchemaPackage == "tfschema" { + return `"` + p.SchemaPackagePath + `"` + } + + return p.SchemaPackage + ` "` + p.SchemaPackagePath + `"` + }, + "protoImport": func(p payload) string { + if p.ConvertPackagePath != "" { + return "convert" + ` "` + p.ConvertPackagePath + `"` + } + + return p.ProtoPackage + ` "` + p.ProtoPackagePath + `"` + }, + } + + t, err := template.New(p.Name).Funcs(funcs).ParseFiles(path.Join("gen", tpl)) if err != nil { log.Fatal(err) } diff --git a/terraform/gen/plural_data_source.go.tpl b/terraform/gen/plural_data_source.go.tpl index 8ce988456..6eb0c603f 100644 --- a/terraform/gen/plural_data_source.go.tpl +++ b/terraform/gen/plural_data_source.go.tpl @@ -20,20 +20,16 @@ package provider import ( "context" + {{ if not .IsPlainStruct }} + {{- protoImport . }} + {{ end }} + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - {{.SchemaPackage}} "{{.SchemaPackagePath}}" - {{if not .IsPlainStruct -}} - {{- if .ConvertPackagePath}} - convert "{{.ConvertPackagePath}}" - {{ else }} - {{.ProtoPackage}} "{{.ProtoPackagePath}}" - {{- end}} - {{end -}} - "github.com/gravitational/trace" + {{ schemaImport . }} ) // dataSourceTeleport{{.Name}}Type is the data source metadata type diff --git a/terraform/gen/plural_resource.go.tpl b/terraform/gen/plural_resource.go.tpl index 6ae017591..12ed646a1 100644 --- a/terraform/gen/plural_resource.go.tpl +++ b/terraform/gen/plural_resource.go.tpl @@ -19,31 +19,30 @@ package provider import ( "context" +{{- if .RandomMetadataName }} + "crypto/rand" + "encoding/hex" +{{- end }} "fmt" -{{- if .RandomMetadataName}} - "crypto/rand" - "encoding/hex" -{{- end}} -{{- if .UUIDMetadataName}} - "github.com/google/uuid" -{{- end}} -{{- range $i, $a := .ExtraImports}} +{{- range $i, $a := .ExtraImports }} "{{$a}}" -{{- end}} - - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - +{{- end }} +{{ if .UUIDMetadataName }} + "github.com/google/uuid" +{{- end }} {{.ProtoPackage}} "{{.ProtoPackagePath}}" - {{.SchemaPackage}} "{{.SchemaPackagePath}}" -{{- if .ConvertPackagePath}} - convert "{{.ConvertPackagePath}}" -{{- end}} + {{ if .ConvertPackagePath -}} + convert "{{.ConvertPackagePath}}" + {{- end}} "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + {{ schemaImport . }} ) // resourceTeleport{{.Name}}Type is the resource metadata type diff --git a/terraform/gen/singular_data_source.go.tpl b/terraform/gen/singular_data_source.go.tpl index 88e1cb312..b7c1ac2ac 100644 --- a/terraform/gen/singular_data_source.go.tpl +++ b/terraform/gen/singular_data_source.go.tpl @@ -20,15 +20,15 @@ package provider import ( "context" + {{ if not .IsPlainStruct }} + {{- protoImport . }} + {{- end }} + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - {{.SchemaPackage}} "{{.SchemaPackagePath}}" - {{if not .IsPlainStruct -}} - {{.ProtoPackage}} "{{.ProtoPackagePath}}" - {{end -}} - "github.com/gravitational/trace" + {{ schemaImport . }} ) // dataSourceTeleport{{.Name}}Type is the data source metadata type diff --git a/terraform/gen/singular_resource.go.tpl b/terraform/gen/singular_resource.go.tpl index ef6b4b3dd..5483b0a0e 100644 --- a/terraform/gen/singular_resource.go.tpl +++ b/terraform/gen/singular_resource.go.tpl @@ -24,15 +24,15 @@ import ( "math" {{- end}} - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - {{.ProtoPackage}} "{{.ProtoPackagePath}}" - {{.SchemaPackage}} "{{.SchemaPackagePath}}" "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + {{ schemaImport . }} ) // resourceTeleport{{.Name}}Type is the resource metadata type diff --git a/terraform/provider/data_source_teleport_access_list.go b/terraform/provider/data_source_teleport_access_list.go index 0cc6aca02..20896df05 100755 --- a/terraform/provider/data_source_teleport_access_list.go +++ b/terraform/provider/data_source_teleport_access_list.go @@ -20,16 +20,15 @@ package provider import ( "context" + convert "github.com/gravitational/teleport/api/types/accesslist/convert/v1" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/accesslist/v1" - - convert "github.com/gravitational/teleport/api/types/accesslist/convert/v1" - - "github.com/gravitational/trace" ) // dataSourceTeleportAccessListType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_app.go b/terraform/provider/data_source_teleport_app.go index 976313a16..56eb9a29d 100755 --- a/terraform/provider/data_source_teleport_app.go +++ b/terraform/provider/data_source_teleport_app.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportAppType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_auth_preference.go b/terraform/provider/data_source_teleport_auth_preference.go index 63984f267..add59d31d 100755 --- a/terraform/provider/data_source_teleport_auth_preference.go +++ b/terraform/provider/data_source_teleport_auth_preference.go @@ -20,13 +20,13 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportAuthPreferenceType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_cluster_maintenance_config.go b/terraform/provider/data_source_teleport_cluster_maintenance_config.go index cc692e059..f30045860 100755 --- a/terraform/provider/data_source_teleport_cluster_maintenance_config.go +++ b/terraform/provider/data_source_teleport_cluster_maintenance_config.go @@ -20,13 +20,13 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportClusterMaintenanceConfigType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_cluster_networking_config.go b/terraform/provider/data_source_teleport_cluster_networking_config.go index 2d05849c2..cd9f19f06 100755 --- a/terraform/provider/data_source_teleport_cluster_networking_config.go +++ b/terraform/provider/data_source_teleport_cluster_networking_config.go @@ -20,13 +20,13 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportClusterNetworkingConfigType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_database.go b/terraform/provider/data_source_teleport_database.go index 415c489aa..89ebcc511 100755 --- a/terraform/provider/data_source_teleport_database.go +++ b/terraform/provider/data_source_teleport_database.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportDatabaseType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_device_trust.go b/terraform/provider/data_source_teleport_device_trust.go index 75bd0a857..645abe64f 100755 --- a/terraform/provider/data_source_teleport_device_trust.go +++ b/terraform/provider/data_source_teleport_device_trust.go @@ -20,13 +20,14 @@ package provider import ( "context" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema/devicetrust/v1" - "github.com/gravitational/trace" + schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/devicetrust/v1" ) // dataSourceTeleportDeviceV1Type is the data source metadata type @@ -39,7 +40,7 @@ type dataSourceTeleportDeviceV1 struct { // GetSchema returns the data source schema func (r dataSourceTeleportDeviceV1Type) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { - return tfschema.GenSchemaDeviceV1(ctx) + return schemav1.GenSchemaDeviceV1(ctx) } // NewDataSource creates the empty data source @@ -67,7 +68,7 @@ func (r dataSourceTeleportDeviceV1) Read(ctx context.Context, req tfsdk.ReadData var state types.Object trustedDevice := trustedDeviceI - diags = tfschema.CopyDeviceV1ToTerraform(ctx, trustedDevice, &state) + diags = schemav1.CopyDeviceV1ToTerraform(ctx, trustedDevice, &state) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/terraform/provider/data_source_teleport_github_connector.go b/terraform/provider/data_source_teleport_github_connector.go index 19bd2880a..9f810b28e 100755 --- a/terraform/provider/data_source_teleport_github_connector.go +++ b/terraform/provider/data_source_teleport_github_connector.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportGithubConnectorType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_login_rule.go b/terraform/provider/data_source_teleport_login_rule.go index b2c645aed..7d6844cd5 100755 --- a/terraform/provider/data_source_teleport_login_rule.go +++ b/terraform/provider/data_source_teleport_login_rule.go @@ -20,13 +20,14 @@ package provider import ( "context" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/loginrule/v1" - "github.com/gravitational/trace" ) // dataSourceTeleportLoginRuleType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_oidc_connector.go b/terraform/provider/data_source_teleport_oidc_connector.go index b8c864cba..6786142b1 100755 --- a/terraform/provider/data_source_teleport_oidc_connector.go +++ b/terraform/provider/data_source_teleport_oidc_connector.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportOIDCConnectorType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_okta_import_rule.go b/terraform/provider/data_source_teleport_okta_import_rule.go index 51e21bc98..30ee95dbb 100755 --- a/terraform/provider/data_source_teleport_okta_import_rule.go +++ b/terraform/provider/data_source_teleport_okta_import_rule.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportOktaImportRuleType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_provision_token.go b/terraform/provider/data_source_teleport_provision_token.go index d2d3c84d5..eece96ebf 100755 --- a/terraform/provider/data_source_teleport_provision_token.go +++ b/terraform/provider/data_source_teleport_provision_token.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportProvisionTokenType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_role.go b/terraform/provider/data_source_teleport_role.go index e7f789555..8f6d3ee33 100755 --- a/terraform/provider/data_source_teleport_role.go +++ b/terraform/provider/data_source_teleport_role.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportRoleType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_saml_connector.go b/terraform/provider/data_source_teleport_saml_connector.go index 04190864c..c19dc19f3 100755 --- a/terraform/provider/data_source_teleport_saml_connector.go +++ b/terraform/provider/data_source_teleport_saml_connector.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportSAMLConnectorType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_session_recording_config.go b/terraform/provider/data_source_teleport_session_recording_config.go index 912642959..ec32de96e 100755 --- a/terraform/provider/data_source_teleport_session_recording_config.go +++ b/terraform/provider/data_source_teleport_session_recording_config.go @@ -20,13 +20,13 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportSessionRecordingConfigType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_trusted_cluster.go b/terraform/provider/data_source_teleport_trusted_cluster.go index 5136243d5..5d735fabe 100755 --- a/terraform/provider/data_source_teleport_trusted_cluster.go +++ b/terraform/provider/data_source_teleport_trusted_cluster.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportTrustedClusterType is the data source metadata type diff --git a/terraform/provider/data_source_teleport_user.go b/terraform/provider/data_source_teleport_user.go index 8ca3d0617..84acfe7e9 100755 --- a/terraform/provider/data_source_teleport_user.go +++ b/terraform/provider/data_source_teleport_user.go @@ -20,15 +20,15 @@ package provider import ( "context" + apitypes "github.com/gravitational/teleport/api/types" + + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" - - apitypes "github.com/gravitational/teleport/api/types" - "github.com/gravitational/trace" + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // dataSourceTeleportUserType is the data source metadata type diff --git a/terraform/provider/resource_teleport_access_list.go b/terraform/provider/resource_teleport_access_list.go index 42b037b74..43493e0fe 100755 --- a/terraform/provider/resource_teleport_access_list.go +++ b/terraform/provider/resource_teleport_access_list.go @@ -21,17 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - accesslist "github.com/gravitational/teleport/api/gen/proto/go/teleport/accesslist/v1" - schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/accesslist/v1" convert "github.com/gravitational/teleport/api/types/accesslist/convert/v1" "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/accesslist/v1" ) // resourceTeleportAccessListType is the resource metadata type diff --git a/terraform/provider/resource_teleport_app.go b/terraform/provider/resource_teleport_app.go index 358c7cba9..e4dee092c 100755 --- a/terraform/provider/resource_teleport_app.go +++ b/terraform/provider/resource_teleport_app.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportAppType is the resource metadata type diff --git a/terraform/provider/resource_teleport_auth_preference.go b/terraform/provider/resource_teleport_auth_preference.go index 8df502656..063ae88d6 100755 --- a/terraform/provider/resource_teleport_auth_preference.go +++ b/terraform/provider/resource_teleport_auth_preference.go @@ -21,15 +21,15 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportAuthPreferenceType is the resource metadata type diff --git a/terraform/provider/resource_teleport_cluster_maintenance_config.go b/terraform/provider/resource_teleport_cluster_maintenance_config.go index f02a8c0ea..45147cc48 100755 --- a/terraform/provider/resource_teleport_cluster_maintenance_config.go +++ b/terraform/provider/resource_teleport_cluster_maintenance_config.go @@ -22,15 +22,15 @@ import ( "fmt" "math" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportClusterMaintenanceConfigType is the resource metadata type diff --git a/terraform/provider/resource_teleport_cluster_networking_config.go b/terraform/provider/resource_teleport_cluster_networking_config.go index dbcc573df..1bc58b4b2 100755 --- a/terraform/provider/resource_teleport_cluster_networking_config.go +++ b/terraform/provider/resource_teleport_cluster_networking_config.go @@ -21,15 +21,15 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportClusterNetworkingConfigType is the resource metadata type diff --git a/terraform/provider/resource_teleport_database.go b/terraform/provider/resource_teleport_database.go index 82df15ef9..6b7862d08 100755 --- a/terraform/provider/resource_teleport_database.go +++ b/terraform/provider/resource_teleport_database.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportDatabaseType is the resource metadata type diff --git a/terraform/provider/resource_teleport_device_trust.go b/terraform/provider/resource_teleport_device_trust.go index 47c38c7fc..c73ca28cc 100755 --- a/terraform/provider/resource_teleport_device_trust.go +++ b/terraform/provider/resource_teleport_device_trust.go @@ -20,18 +20,19 @@ package provider import ( "context" "fmt" - "github.com/google/uuid" - - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/google/uuid" apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema/devicetrust/v1" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/devicetrust/v1" ) // resourceTeleportDeviceV1Type is the resource metadata type @@ -44,7 +45,7 @@ type resourceTeleportDeviceV1 struct { // GetSchema returns the resource schema func (r resourceTeleportDeviceV1Type) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { - return tfschema.GenSchemaDeviceV1(ctx) + return schemav1.GenSchemaDeviceV1(ctx) } // NewResource creates the empty resource @@ -69,7 +70,7 @@ func (r resourceTeleportDeviceV1) Create(ctx context.Context, req tfsdk.CreateRe } trustedDevice := &apitypes.DeviceV1{} - diags = tfschema.CopyDeviceV1FromTerraform(ctx, plan, trustedDevice) + diags = schemav1.CopyDeviceV1FromTerraform(ctx, plan, trustedDevice) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -134,7 +135,7 @@ func (r resourceTeleportDeviceV1) Create(ctx context.Context, req tfsdk.CreateRe trustedDevice = trustedDeviceResource - diags = tfschema.CopyDeviceV1ToTerraform(ctx, trustedDevice, &plan) + diags = schemav1.CopyDeviceV1ToTerraform(ctx, trustedDevice, &plan) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -176,7 +177,7 @@ func (r resourceTeleportDeviceV1) Read(ctx context.Context, req tfsdk.ReadResour return } trustedDevice := trustedDeviceI - diags = tfschema.CopyDeviceV1ToTerraform(ctx, trustedDevice, &state) + diags = schemav1.CopyDeviceV1ToTerraform(ctx, trustedDevice, &state) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -204,7 +205,7 @@ func (r resourceTeleportDeviceV1) Update(ctx context.Context, req tfsdk.UpdateRe } trustedDevice := &apitypes.DeviceV1{} - diags = tfschema.CopyDeviceV1FromTerraform(ctx, plan, trustedDevice) + diags = schemav1.CopyDeviceV1FromTerraform(ctx, plan, trustedDevice) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -254,7 +255,7 @@ func (r resourceTeleportDeviceV1) Update(ctx context.Context, req tfsdk.UpdateRe trustedDeviceResource = trustedDeviceI - diags = tfschema.CopyDeviceV1ToTerraform(ctx, trustedDevice, &plan) + diags = schemav1.CopyDeviceV1ToTerraform(ctx, trustedDevice, &plan) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return @@ -304,7 +305,7 @@ func (r resourceTeleportDeviceV1) ImportState(ctx context.Context, req tfsdk.Imp return } - diags = tfschema.CopyDeviceV1ToTerraform(ctx, trustedDeviceResource, &state) + diags = schemav1.CopyDeviceV1ToTerraform(ctx, trustedDeviceResource, &state) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/terraform/provider/resource_teleport_github_connector.go b/terraform/provider/resource_teleport_github_connector.go index ca5e17a39..2e6bd22e3 100755 --- a/terraform/provider/resource_teleport_github_connector.go +++ b/terraform/provider/resource_teleport_github_connector.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportGithubConnectorType is the resource metadata type diff --git a/terraform/provider/resource_teleport_login_rule.go b/terraform/provider/resource_teleport_login_rule.go index 4ca5c2d1d..f32071474 100755 --- a/terraform/provider/resource_teleport_login_rule.go +++ b/terraform/provider/resource_teleport_login_rule.go @@ -21,16 +21,17 @@ import ( "context" "fmt" + loginrulev1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/loginrule/v1" + + "github.com/gravitational/teleport/integrations/lib/backoff" + "github.com/gravitational/trace" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/jonboulle/clockwork" - loginrulev1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/loginrule/v1" schemav1 "github.com/gravitational/teleport-plugins/terraform/tfschema/loginrule/v1" - "github.com/gravitational/teleport/integrations/lib/backoff" - "github.com/gravitational/trace" - "github.com/jonboulle/clockwork" ) // resourceTeleportLoginRuleType is the resource metadata type diff --git a/terraform/provider/resource_teleport_oidc_connector.go b/terraform/provider/resource_teleport_oidc_connector.go index 6253f45c7..f09229b27 100755 --- a/terraform/provider/resource_teleport_oidc_connector.go +++ b/terraform/provider/resource_teleport_oidc_connector.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportOIDCConnectorType is the resource metadata type diff --git a/terraform/provider/resource_teleport_okta_import_rule.go b/terraform/provider/resource_teleport_okta_import_rule.go index 0b0ab51a2..c39fc8c80 100755 --- a/terraform/provider/resource_teleport_okta_import_rule.go +++ b/terraform/provider/resource_teleport_okta_import_rule.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportOktaImportRuleType is the resource metadata type diff --git a/terraform/provider/resource_teleport_provision_token.go b/terraform/provider/resource_teleport_provision_token.go index e599ff4b7..a360104e8 100755 --- a/terraform/provider/resource_teleport_provision_token.go +++ b/terraform/provider/resource_teleport_provision_token.go @@ -19,21 +19,22 @@ package provider import ( "context" + "crypto/rand" + "encoding/hex" "fmt" - "crypto/rand" - "encoding/hex" "strconv" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportProvisionTokenType is the resource metadata type diff --git a/terraform/provider/resource_teleport_role.go b/terraform/provider/resource_teleport_role.go index 81b0df7c9..8bcdb751d 100755 --- a/terraform/provider/resource_teleport_role.go +++ b/terraform/provider/resource_teleport_role.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportRoleType is the resource metadata type diff --git a/terraform/provider/resource_teleport_saml_connector.go b/terraform/provider/resource_teleport_saml_connector.go index e0d93cbb2..23b4f9d54 100755 --- a/terraform/provider/resource_teleport_saml_connector.go +++ b/terraform/provider/resource_teleport_saml_connector.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportSAMLConnectorType is the resource metadata type diff --git a/terraform/provider/resource_teleport_session_recording_config.go b/terraform/provider/resource_teleport_session_recording_config.go index 3b8eeeb16..c4718a97a 100755 --- a/terraform/provider/resource_teleport_session_recording_config.go +++ b/terraform/provider/resource_teleport_session_recording_config.go @@ -21,15 +21,15 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportSessionRecordingConfigType is the resource metadata type diff --git a/terraform/provider/resource_teleport_trusted_cluster.go b/terraform/provider/resource_teleport_trusted_cluster.go index 612066eb3..1312b98b4 100755 --- a/terraform/provider/resource_teleport_trusted_cluster.go +++ b/terraform/provider/resource_teleport_trusted_cluster.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportTrustedClusterType is the resource metadata type diff --git a/terraform/provider/resource_teleport_user.go b/terraform/provider/resource_teleport_user.go index ab68cd350..e7e656163 100755 --- a/terraform/provider/resource_teleport_user.go +++ b/terraform/provider/resource_teleport_user.go @@ -21,16 +21,17 @@ import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/path" - apitypes "github.com/gravitational/teleport/api/types" - tfschema "github.com/gravitational/teleport-plugins/terraform/tfschema" + "github.com/gravitational/teleport/integrations/lib/backoff" "github.com/gravitational/trace" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/jonboulle/clockwork" + + "github.com/gravitational/teleport-plugins/terraform/tfschema" ) // resourceTeleportUserType is the resource metadata type