diff --git a/.changelog/5137.txt b/.changelog/5137.txt new file mode 100644 index 00000000000..40f54ae4266 --- /dev/null +++ b/.changelog/5137.txt @@ -0,0 +1,3 @@ +```release-note:bug +Endpoints: fixed a timezone discrepancy in `config_id` on `google_endpoints_service` +``` diff --git a/google/resource_endpoints_service.go b/google/resource_endpoints_service.go index 7f800bce087..64ec9191b3b 100644 --- a/google/resource_endpoints_service.go +++ b/google/resource_endpoints_service.go @@ -155,12 +155,7 @@ func predictServiceId(_ context.Context, d *schema.ResourceDiff, meta interface{ if !d.HasChange("openapi_config") && !d.HasChange("grpc_config") && !d.HasChange("protoc_output_base64") { return nil } - loc, err := time.LoadLocation("America/Los_Angeles") - if err != nil { - // Timezone data may not be present on some machines, in that case skip - return nil - } - baseDate := time.Now().In(loc).Format("2006-01-02") + baseDate := time.Now().Format("2006-01-02") oldConfigId := d.Get("config_id").(string) if match, err := regexp.MatchString(`\d\d\d\d-\d\d-\d\dr\d*`, oldConfigId); !match || err != nil { // If we do not match the expected format, we will guess