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

Modify max_instances to take API's result as default value #13575

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
3 changes: 3 additions & 0 deletions .changelog/7153.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
GCF: modify max_instances field to take API's result as default value
```
2 changes: 1 addition & 1 deletion google/resource_cloudfunctions_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func resourceCloudFunctionsFunction() *schema.Resource {
"max_instances": {
Type: schema.TypeInt,
Optional: true,
Default: 0,
Computed: true,
ValidateFunc: validation.IntAtLeast(0),
Description: `The limit on the maximum number of function instances that may coexist at a given time.`,
},
Expand Down
4 changes: 4 additions & 0 deletions google/resource_cloudfunctions_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ func TestAccCloudFunctionsFunction_pubsub(t *testing.T) {
{
Config: testAccCloudFunctionsFunction_pubsub(functionName, bucketName,
topicName, zipFilePath),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(funcResourceName,
"max_instances", "3000"),
),
},
{
ResourceName: funcResourceName,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/cloudfunctions_function.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ exported:
* `service_account_email` - The service account email to be assumed by the cloud function.
* `vpc_connector` - The VPC Network Connector that this cloud function can connect to.
* `vpc_connector_egress_settings` - The egress settings for the connector, controlling what traffic is diverted through it.
* `max_instances` - The limit on the maximum number of function instances that may coexist at a given time.
* `max_instances` - The limit on the maximum number of function instances that may coexist at a given time. If unset or set to `0`, the API default will be used.
* `source_repository` - The URL of the Cloud Source Repository that the function is deployed from. Structure is [documented below](#nested_source_repository).

<a name="nested_event_trigger"></a>The `event_trigger` block contains:
Expand Down