Skip to content

Commit

Permalink
Update azurerm_policy_set_definition: Make metadata Computed… (#6266)
Browse files Browse the repository at this point in the history
The field metadata may return some values from the service after creation (for instance, time created on, etc), therefore it should be Computed: true like the metadata in azurerm_policy_definition.
  • Loading branch information
ArcturusZhang authored Mar 30, 2020
1 parent c4312ac commit ec9174b
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 ec9174b

Please sign in to comment.