Skip to content

Commit

Permalink
Made google_document_ai_processor_default_version test ignore changes…
Browse files Browse the repository at this point in the history
… to version field (hashicorp#7317) (hashicorp#13781)

* Fixed permadiff for channel-based processor versions

* Removed update functionality and updated tests & docs to use ignore_changes

* Tweaked docs example

* Removed update settings

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Feb 17, 2023
1 parent fdc4d23 commit beb950e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .changelog/7317.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
3 changes: 2 additions & 1 deletion google/resource_document_ai_processor_default_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func resourceDocumentAIProcessorDefaultVersion() *schema.Resource {
Required: true,
ForceNew: true,
DiffSuppressFunc: projectNumberDiffSuppress,
Description: `The version to set`,
Description: `The version to set. Using 'stable' or 'rc' will cause the API to return the latest version in that release channel.
Apply 'lifecycle.ignore_changes' to the 'version' field to suppress this diff.`,
},
},
UseJSONNumber: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ resource "google_document_ai_processor" "processor" {
resource "google_document_ai_processor_default_version" "processor" {
processor = google_document_ai_processor.processor.id
version = "${google_document_ai_processor.processor.id}/processorVersions/pretrained-next"
version = "${google_document_ai_processor.processor.id}/processorVersions/stable"
lifecycle {
ignore_changes = [
# Using "stable" or "rc" will return a specific version from the API; suppressing the diff.
version,
]
}
}
`, context)
}
12 changes: 10 additions & 2 deletions website/docs/r/document_ai_processor_default_version.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ resource "google_document_ai_processor" "processor" {
resource "google_document_ai_processor_default_version" "processor" {
processor = google_document_ai_processor.processor.id
version = "${google_document_ai_processor.processor.id}/processorVersions/pretrained-next"
version = "${google_document_ai_processor.processor.id}/processorVersions/stable"
lifecycle {
ignore_changes = [
# Using "stable" or "rc" will return a specific version from the API; suppressing the diff.
version,
]
}
}
```

Expand All @@ -51,7 +58,8 @@ The following arguments are supported:

* `version` -
(Required)
The version to set
The version to set. Using `stable` or `rc` will cause the API to return the latest version in that release channel.
Apply `lifecycle.ignore_changes` to the `version` field to suppress this diff.

* `processor` -
(Required)
Expand Down

0 comments on commit beb950e

Please sign in to comment.