-
Notifications
You must be signed in to change notification settings - Fork 43
/
resource_group_name.go
74 lines (65 loc) · 1.86 KB
/
resource_group_name.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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package commonschema
import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/resourcegroups"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func ResourceGroupName() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: resourcegroups.ValidateName,
}
}
func ResourceGroupNameDeprecated() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Optional: true,
ValidateFunc: resourcegroups.ValidateName,
Deprecated: "This field is no longer used and will be removed in the next major version of the Azure Provider",
}
}
func ResourceGroupNameDeprecatedComputed() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: resourcegroups.ValidateName,
Deprecated: "This field is no longer used and will be removed in the next major version of the Azure Provider",
}
}
func ResourceGroupNameForDataSource() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Required: true,
ValidateFunc: resourcegroups.ValidateName,
}
}
func ResourceGroupNameOptionalComputed() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
ForceNew: true,
Optional: true,
Computed: true,
ValidateFunc: resourcegroups.ValidateName,
}
}
func ResourceGroupNameOptional() *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Optional: true,
ValidateFunc: resourcegroups.ValidateName,
}
}
func ResourceGroupNameSetOptional() *schema.Schema {
return &schema.Schema{
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: resourcegroups.ValidateName,
},
}
}