Shuffle schema in BackendService around to match what MM will do (#3340)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2019-03-29 15:12:51 -07:00 committed by Riley Karson
parent e12b5c2a04
commit 8b6a334ff9

View File

@ -38,78 +38,16 @@ func resourceComputeBackendService() *schema.Resource {
MaxItems: 1, MaxItems: 1,
}, },
"iap": { "affinity_cookie_ttl_sec": {
Type: schema.TypeList, Type: schema.TypeInt,
Optional: true, Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"oauth2_client_id": {
Type: schema.TypeString,
Required: true,
},
"oauth2_client_secret": {
Type: schema.TypeString,
Required: true,
Sensitive: true,
},
"oauth2_client_secret_sha256": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},
},
},
}, },
"backend": { "backend": {
Type: schema.TypeSet, Type: schema.TypeSet,
Optional: true, Optional: true,
Set: resourceGoogleComputeBackendServiceBackendHash, Set: resourceGoogleComputeBackendServiceBackendHash,
Elem: &schema.Resource{ Elem: computeBackendServiceBackendSchema(),
Schema: map[string]*schema.Schema{
"group": {
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: compareSelfLinkRelativePaths,
},
"balancing_mode": {
Type: schema.TypeString,
Optional: true,
Default: "UTILIZATION",
},
"capacity_scaler": {
Type: schema.TypeFloat,
Optional: true,
Default: 1,
},
"description": {
Type: schema.TypeString,
Optional: true,
},
"max_rate": {
Type: schema.TypeInt,
Optional: true,
},
"max_rate_per_instance": {
Type: schema.TypeFloat,
Optional: true,
},
"max_connections": {
Type: schema.TypeInt,
Optional: true,
},
"max_connections_per_instance": {
Type: schema.TypeInt,
Optional: true,
},
"max_utilization": {
Type: schema.TypeFloat,
Optional: true,
Default: 0.8,
},
},
},
}, },
"cdn_policy": { "cdn_policy": {
@ -156,6 +94,12 @@ func resourceComputeBackendService() *schema.Resource {
}, },
}, },
"connection_draining_timeout_sec": {
Type: schema.TypeInt,
Optional: true,
Default: 300,
},
"custom_request_headers": { "custom_request_headers": {
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.", Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
Type: schema.TypeSet, Type: schema.TypeSet,
@ -180,19 +124,36 @@ func resourceComputeBackendService() *schema.Resource {
Computed: true, Computed: true,
}, },
"iap": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"oauth2_client_id": {
Type: schema.TypeString,
Required: true,
},
"oauth2_client_secret": {
Type: schema.TypeString,
Required: true,
Sensitive: true,
},
"oauth2_client_secret_sha256": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},
},
},
},
"port_name": { "port_name": {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Computed: true, Computed: true,
}, },
"project": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"protocol": { "protocol": {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
@ -212,32 +173,75 @@ func resourceComputeBackendService() *schema.Resource {
DiffSuppressFunc: compareSelfLinkOrResourceName, DiffSuppressFunc: compareSelfLinkOrResourceName,
}, },
"self_link": {
Type: schema.TypeString,
Computed: true,
},
"session_affinity": { "session_affinity": {
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Computed: true, Computed: true,
}, },
"affinity_cookie_ttl_sec": {
Type: schema.TypeInt,
Optional: true,
},
"timeout_sec": { "timeout_sec": {
Type: schema.TypeInt, Type: schema.TypeInt,
Optional: true, Optional: true,
Computed: true, Computed: true,
}, },
"connection_draining_timeout_sec": { "project": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"self_link": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
func computeBackendServiceBackendSchema() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"group": {
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: compareSelfLinkRelativePaths,
},
"balancing_mode": {
Type: schema.TypeString,
Optional: true,
Default: "UTILIZATION",
},
"capacity_scaler": {
Type: schema.TypeFloat,
Optional: true,
Default: 1,
},
"description": {
Type: schema.TypeString,
Optional: true,
},
"max_rate": {
Type: schema.TypeInt, Type: schema.TypeInt,
Optional: true, Optional: true,
Default: 300, },
"max_rate_per_instance": {
Type: schema.TypeFloat,
Optional: true,
},
"max_connections": {
Type: schema.TypeInt,
Optional: true,
},
"max_connections_per_instance": {
Type: schema.TypeInt,
Optional: true,
},
"max_utilization": {
Type: schema.TypeFloat,
Optional: true,
Default: 0.8,
}, },
}, },
} }