mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-05 17:52:38 +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,
|
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
|
const functionDefaultAllowedMemoryMb = 256
|
||||||
|
|
||||||
type cloudFunctionId struct {
|
type cloudFunctionId struct {
|
||||||
|
@ -287,7 +283,6 @@ func resourceCloudFunctionsFunction() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validCloudFunctionRegion,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -305,14 +300,6 @@ func resourceCloudFunctionsCreate(d *schema.ResourceData, meta interface{}) erro
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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{
|
cloudFuncId := &cloudFunctionId{
|
||||||
Project: project,
|
Project: project,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user