-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add support for processing_units
to google_spanner_instance
#4993
Merged
c2thorn
merged 4 commits into
GoogleCloudPlatform:master
from
borg-land:spanner-processing-units
Aug 3, 2021
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,11 @@ overrides: !ruby/object:Overrides::ResourceOverrides | |
primary_resource_id: "example" | ||
# Randomness | ||
skip_vcr: true | ||
- !ruby/object:Provider::Terraform::Examples | ||
name: "spanner_instance_processing_units" | ||
primary_resource_id: "example" | ||
# Randomness | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the randomness here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know. Copied the other block |
||
skip_vcr: true | ||
- !ruby/object:Provider::Terraform::Examples | ||
name: "spanner_instance_multi_regional" | ||
primary_resource_id: "example" | ||
|
@@ -108,6 +113,9 @@ overrides: !ruby/object:Overrides::ResourceOverrides | |
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb' | ||
nodeCount: !ruby/object:Overrides::Terraform::PropertyOverride | ||
name: num_nodes | ||
default_from_api: true | ||
processingUnits: !ruby/object:Overrides::Terraform::PropertyOverride | ||
default_from_api: true | ||
config: !ruby/object:Overrides::Terraform::PropertyOverride | ||
custom_expand: templates/terraform/custom_expand/spanner_instance_config.go.erb | ||
state: !ruby/object:Overrides::Terraform::PropertyOverride | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
mmv1/templates/terraform/examples/spanner_instance_processing_units.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
resource "google_spanner_instance" "example" { | ||
config = "regional-us-central1" | ||
display_name = "Test Spanner Instance" | ||
processing_units = 200 | ||
labels = { | ||
"foo" = "bar" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by note: While removing a default is a safe change, that's only if the field is moved to
Optional
+Computed
. We may need to use aCustomizeDiff
to simulate a default of1
whenprocessing_units
is unset, as breaking a config like the following working would also be backwards-incompatible. (Changing API requirements make backwards compatibility difficult!)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about if:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that should also work. We should make sure to test a config w/o an explicit
node_count
if we don't already.