Redefine project_name schema
@@ -14,11 +14,7 @@ import (
func DataProject() *schema.Resource {
baseSchema := ResourceProject()
for k, v := range baseSchema.Schema {
- if k == "project_name" {
- v.Required = false
- v.Optional = true
- baseSchema.Schema[k] = v
- } else {
+ if k != "project_name" {
baseSchema.Schema[k] = &schema.Schema{
Type: v.Type,
Computed: true,
@@ -26,6 +22,13 @@ func DataProject() *schema.Resource {
}
}
+ baseSchema.Schema["project_name"] = &schema.Schema{
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: validation.StringIsNotWhiteSpace,
+ DiffSuppressFunc: suppress.CaseDifference,
+ }
+
baseSchema.Schema["project_id"] = &schema.Schema{
Type: schema.TypeString,
Optional: true,
