Skip to content

Commit

Permalink
Make metadata Computed to avoid some unexpected diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcturusZhang committed Mar 27, 2020
1 parent 3af2146 commit 6e1ef8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func resourceArmPolicySetDefinition() *schema.Resource {
"metadata": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringIsJSON,
DiffSuppressFunc: structure.SuppressJsonDiff,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import (
"testing"

"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/policy"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"

"github.com/hashicorp/terraform-plugin-sdk/terraform"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccAzureRMPolicySetDefinition_builtIn(t *testing.T) {
Expand All @@ -34,11 +31,6 @@ func TestAccAzureRMPolicySetDefinition_builtIn(t *testing.T) {
}

func TestAccAzureRMPolicySetDefinition_requiresImport(t *testing.T) {
if !features.ShouldResourcesBeImported() {
t.Skip("Skipping since resources aren't required to be imported")
return
}

data := acceptance.BuildTestData(t, "azurerm_policy_set_definition", "test")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acceptance.PreCheck(t) },
Expand Down

0 comments on commit 6e1ef8a

Please sign in to comment.