Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/policy_definition: allowing the metadata field to be Computed #2939

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

tombuildsstuff
Copy link
Contributor

Before making this field Computed:

$ acctests azurerm TestAccAzureRMPolicyDefinition_computedMetadata
=== RUN   TestAccAzureRMPolicyDefinition_computedMetadata
=== PAUSE TestAccAzureRMPolicyDefinition_computedMetadata
=== CONT  TestAccAzureRMPolicyDefinition_computedMetadata
--- FAIL: TestAccAzureRMPolicyDefinition_computedMetadata (124.69s)
    testing.go:538: Step 0 error: After applying this step, the plan was not empty:

        DIFF:

        UPDATE: azurerm_policy_definition.test
          metadata: "{\"createdBy\":\"08235c12-5479-4b9b-9f0f-4dd1e700a4e0\",\"createdOn\":\"2019-02-22T16:31:04.2856389Z\",\"updatedBy\":null,\"updatedOn\":null}" => ""

        STATE:

        azurerm_policy_definition.test:
          ID = /subscriptions/c0a607b2-6372-4ef3-abdb-dbe52a7b56ba/providers/Microsoft.Authorization/policyDefinitions/acctest-190222173052556885
          provider = provider.azurerm
          description =
          display_name = DefaultTags
          management_group_id =
          metadata = {"createdBy":"08235c12-5479-4b9b-9f0f-4dd1e700a4e0","createdOn":"2019-02-22T16:31:04.2856389Z","updatedBy":null,"updatedOn":null}
          mode = Indexed
          name = acctest-190222173052556885
          policy_rule = {"if":{"exists":"false","field":"tags"},"then":{"details":[{"field":"tags","value":{"application":"Portal","environment":"D-137","implementor":"Morty","owner":"Rick"}}],"effect":"append"}}
          policy_type = Custom
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	125.758s

After making this field Computed:

$ acctests azurerm TestAccAzureRMPolicyDefinition_computedMetadata
=== RUN   TestAccAzureRMPolicyDefinition_computedMetadata
=== PAUSE TestAccAzureRMPolicyDefinition_computedMetadata
=== CONT  TestAccAzureRMPolicyDefinition_computedMetadata
--- PASS: TestAccAzureRMPolicyDefinition_computedMetadata (138.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	139.786s

Fixes #2938

@tombuildsstuff tombuildsstuff added this to the 1.23.0 milestone Feb 22, 2019
@ghost ghost added the size/M label Feb 22, 2019
@tombuildsstuff tombuildsstuff requested a review from a team February 22, 2019 16:41
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@katbyte katbyte merged commit f2c5039 into master Feb 22, 2019
@katbyte katbyte deleted the b/policy-definition branch February 22, 2019 18:49
katbyte added a commit that referenced this pull request Feb 22, 2019
@ghost
Copy link

ghost commented Mar 8, 2019

This has been released in version 1.23.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
	version = "~> 1.23.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 25, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants