Skip to content

Commit

Permalink
Merge pull request #11449 from terraform-providers/r/plugin-sdk-defau…
Browse files Browse the repository at this point in the history
…lt-importer

refactor: updating the default importers to use the plugin-sdk wrapper
  • Loading branch information
tombuildsstuff authored Apr 23, 2021
2 parents 5e6bf2a + c20e771 commit 9d5d4dc
Show file tree
Hide file tree
Showing 253 changed files with 724 additions and 759 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementApiOperationPolicy() *schema.Resource {
Read: resourceApiManagementAPIOperationPolicyRead,
Update: resourceApiManagementAPIOperationPolicyCreateUpdate,
Delete: resourceApiManagementAPIOperationPolicyDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -23,9 +24,8 @@ func resourceApiManagementApiOperation() *schema.Resource {
Read: resourceApiManagementApiOperationRead,
Update: resourceApiManagementApiOperationCreateUpdate,
Delete: resourceApiManagementApiOperationDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementApiPolicy() *schema.Resource {
Read: resourceApiManagementAPIPolicyRead,
Update: resourceApiManagementAPIPolicyCreateUpdate,
Delete: resourceApiManagementAPIPolicyDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -26,9 +27,8 @@ func resourceApiManagementApi() *schema.Resource {
Read: resourceApiManagementApiRead,
Update: resourceApiManagementApiCreateUpdate,
Delete: resourceApiManagementApiDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementApiSchema() *schema.Resource {
Read: resourceApiManagementApiSchemaRead,
Update: resourceApiManagementApiSchemaCreateUpdate,
Delete: resourceApiManagementApiSchemaDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ func resourceApiManagementApiVersionSet() *schema.Resource {
Read: resourceApiManagementApiVersionSetRead,
Update: resourceApiManagementApiVersionSetCreateUpdate,
Delete: resourceApiManagementApiVersionSetDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementAuthorizationServer() *schema.Resource {
Read: resourceApiManagementAuthorizationServerRead,
Update: resourceApiManagementAuthorizationServerCreateUpdate,
Delete: resourceApiManagementAuthorizationServerDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -26,9 +27,8 @@ func resourceApiManagementBackend() *schema.Resource {
Read: resourceApiManagementBackendRead,
Update: resourceApiManagementBackendCreateUpdate,
Delete: resourceApiManagementBackendDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementCertificate() *schema.Resource {
Read: resourceApiManagementCertificateRead,
Update: resourceApiManagementCertificateCreateUpdate,
Delete: resourceApiManagementCertificateDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
Expand All @@ -27,9 +28,8 @@ func resourceApiManagementCustomDomain() *schema.Resource {
Read: apiManagementCustomDomainRead,
Update: apiManagementCustomDomainCreateUpdate,
Delete: apiManagementCustomDomainDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementEmailTemplate() *schema.Resource {
Read: resourceApiManagementEmailTemplateRead,
Update: resourceApiManagementEmailTemplateCreateUpdate,
Delete: resourceApiManagementEmailTemplateDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementGroup() *schema.Resource {
Read: resourceApiManagementGroupRead,
Update: resourceApiManagementGroupCreateUpdate,
Delete: resourceApiManagementGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
Expand All @@ -21,9 +22,8 @@ func resourceApiManagementGroupUser() *schema.Resource {
Create: resourceApiManagementGroupUserCreate,
Read: resourceApiManagementGroupUserRead,
Delete: resourceApiManagementGroupUserDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementIdentityProviderAAD() *schema.Resource {
Read: resourceApiManagementIdentityProviderAADRead,
Update: resourceApiManagementIdentityProviderAADCreateUpdate,
Delete: resourceApiManagementIdentityProviderAADDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -25,9 +26,8 @@ func resourceArmApiManagementIdentityProviderAADB2C() *schema.Resource {
Read: resourceArmApiManagementIdentityProviderAADB2CRead,
Update: resourceArmApiManagementIdentityProviderAADB2CCreateUpdate,
Delete: resourceArmApiManagementIdentityProviderAADB2CDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementIdentityProviderFacebook() *schema.Resource {
Read: resourceApiManagementIdentityProviderFacebookRead,
Update: resourceApiManagementIdentityProviderFacebookCreateUpdate,
Delete: resourceApiManagementIdentityProviderFacebookDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -25,9 +26,8 @@ func resourceApiManagementIdentityProviderGoogle() *schema.Resource {
Read: resourceApiManagementIdentityProviderGoogleRead,
Update: resourceApiManagementIdentityProviderGoogleCreateUpdate,
Delete: resourceApiManagementIdentityProviderGoogleDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementIdentityProviderMicrosoft() *schema.Resource {
Read: resourceApiManagementIdentityProviderMicrosoftRead,
Update: resourceApiManagementIdentityProviderMicrosoftCreateUpdate,
Delete: resourceApiManagementIdentityProviderMicrosoftDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/parse"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/schemaz"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk"

"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
Expand All @@ -24,9 +25,8 @@ func resourceApiManagementIdentityProviderTwitter() *schema.Resource {
Read: resourceApiManagementIdentityProviderTwitterRead,
Update: resourceApiManagementIdentityProviderTwitterCreateUpdate,
Delete: resourceApiManagementIdentityProviderTwitterDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
// TODO: replace this with an importer which validates the ID during import
Importer: pluginsdk.DefaultImporter(),

Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(30 * time.Minute),
Expand Down
Loading

0 comments on commit 9d5d4dc

Please sign in to comment.