Skip to content

Commit

Permalink
r/advanced_threat_protection: adding import time validation of the re…
Browse files Browse the repository at this point in the history
…source id
  • Loading branch information
tombuildsstuff committed Jan 14, 2021
1 parent 09bd111 commit 55826a2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/securitycenter/parse"
azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand All @@ -22,9 +23,10 @@ func resourceAdvancedThreatProtection() *schema.Resource {
Update: resourceAdvancedThreatProtectionCreateUpdate,
Delete: resourceAdvancedThreatProtectionDelete,

Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error {
_, err := parse.AdvancedThreatProtectionID(id)
return err
}),

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

0 comments on commit 55826a2

Please sign in to comment.