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

Make tier ignore_read #3223

Merged
merged 1 commit into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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