mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 07:42:40 +00:00
Remove validation on GCF regions (#3530)
* adding additional GCF regions supported Fixes https://github.com/terraform-providers/terraform-provider-google/issues/3515 https://cloud.google.com/functions/docs/locations * remove region validation from google cloud functions * remove for region check resource creation
This commit is contained in:
parent
a648430f2d
commit
98389c0a0f
|
@ -27,10 +27,6 @@ var functionAllowedMemory = map[int]bool{
|
|||
2048: true,
|
||||
}
|
||||
|
||||
// For now CloudFunctions are allowed only in the following locations.
|
||||
// Please see https://cloud.google.com/about/locations/
|
||||
var validCloudFunctionRegion = validation.StringInSlice([]string{"us-central1", "us-east1", "europe-west1", "asia-northeast1"}, true)
|
||||
|
||||
const functionDefaultAllowedMemoryMb = 256
|
||||
|
||||
type cloudFunctionId struct {
|
||||
|
@ -283,11 +279,10 @@ func resourceCloudFunctionsFunction() *schema.Resource {
|
|||
},
|
||||
|
||||
"region": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: validCloudFunctionRegion,
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -305,14 +300,6 @@ func resourceCloudFunctionsCreate(d *schema.ResourceData, meta interface{}) erro
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// We do this extra validation here since most regions are not valid, and the
|
||||
// error message that Cloud Functions has for "wrong region" is not specific.
|
||||
// Provider-level region fetching skips validation, because it's not possible
|
||||
// for the provider-level region to know about the field-level validator.
|
||||
_, errs := validCloudFunctionRegion(region, "region")
|
||||
if len(errs) > 0 {
|
||||
return errs[0]
|
||||
}
|
||||
|
||||
cloudFuncId := &cloudFunctionId{
|
||||
Project: project,
|
||||
|
|
Loading…
Reference in New Issue
Block a user