-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
schema.go
92 lines (76 loc) · 2.25 KB
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package apimanagement
import (
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
)
func apiManagementResourceHostnameSchema() map[string]*pluginsdk.Schema {
return map[string]*pluginsdk.Schema{
"host_name": {
Type: pluginsdk.TypeString,
Required: true,
DiffSuppressFunc: suppress.CaseDifference,
ValidateFunc: validation.StringIsNotEmpty,
},
"key_vault_id": {
// TODO: 4.0 - should this become `key_vault_key_id` since that's what this is?
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: keyVaultValidate.NestedItemIdWithOptionalVersion,
},
"certificate": {
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
"certificate_password": {
Type: pluginsdk.TypeString,
Optional: true,
Sensitive: true,
ValidateFunc: validation.StringIsNotEmpty,
},
"negotiate_client_certificate": {
Type: pluginsdk.TypeBool,
Optional: true,
Default: false,
},
"ssl_keyvault_identity_client_id": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.IsUUID,
},
"certificate_source": {
Type: pluginsdk.TypeString,
Computed: true,
},
"certificate_status": {
Type: pluginsdk.TypeString,
Computed: true,
},
"expiry": {
Type: pluginsdk.TypeString,
Computed: true,
},
"subject": {
Type: pluginsdk.TypeString,
Computed: true,
},
"thumbprint": {
Type: pluginsdk.TypeString,
Computed: true,
},
}
}
func apiManagementResourceHostnameProxySchema() map[string]*pluginsdk.Schema {
hostnameSchema := apiManagementResourceHostnameSchema()
hostnameSchema["default_ssl_binding"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Optional: true,
Computed: true, // Azure has certain logic to set this, which we cannot predict
}
return hostnameSchema
}