Skip to content

Commit

Permalink
Make tier ignore_read (GoogleCloudPlatform#3223)
Browse files Browse the repository at this point in the history
  • Loading branch information
c2thorn authored and Nathan Klish committed May 18, 2020
1 parent 6ae3107 commit 1a68f30
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 37 deletions.
5 changes: 2 additions & 3 deletions products/dialogflow/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ objects:
* TIER_STANDARD: Standard tier.
* TIER_ENTERPRISE: Enterprise tier (Essentials).
* TIER_ENTERPRISE_PLUS: Enterprise tier (Plus).
NOTE: This field seems to have eventual consistency in the API. Updating this field to a new value, or even
creating a new agent with a tier that is different from a previous agent in the same project will take some
time to propagate. The provider will wait for the API to show consistency, which can lead to longer apply times.
NOTE: Due to consistency issues, the provider will not read this field from the API. Drift is possible between
the Terraform state and Dialogflow if the agent tier is changed outside of Terraform.
values:
- :TIER_STANDARD
- :TIER_ENTERPRISE
Expand Down
5 changes: 1 addition & 4 deletions products/dialogflow/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
matchMode: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
tier: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
custom_code: !ruby/object:Provider::Terraform::CustomCode
post_update: 'templates/terraform/post_create/dialogflow_agent_tier.go.erb'
post_create: 'templates/terraform/post_create/dialogflow_agent_tier.go.erb'
ignore_read: true

# This is for copying files over
files: !ruby/object:Provider::Config::Files
Expand Down
28 changes: 0 additions & 28 deletions templates/terraform/post_create/dialogflow_agent_tier.go.erb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAccDialogflowAgent_update(t *testing.T) {
ResourceName: "google_dialogflow_agent.foobar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"avatar_uri"},
ImportStateVerifyIgnore: []string{"avatar_uri","tier"},
},
{
Config: testAccDialogflowAgent_full2(projectID, orgID, agentNameUpdate),
Expand All @@ -38,7 +38,7 @@ func TestAccDialogflowAgent_update(t *testing.T) {
ResourceName: "google_dialogflow_agent.foobar",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"avatar_uri"},
ImportStateVerifyIgnore: []string{"avatar_uri","tier"},
},
},
})
Expand Down

0 comments on commit 1a68f30

Please sign in to comment.