@@ -18,10 +18,12 @@ func dataSourceRegion() *schema.Resource {
18
18
19
19
Schema : map [string ]* schema.Schema {
20
20
"cloud_account_id" : {
21
- Type : schema .TypeString ,
22
- Optional : true ,
23
- Computed : true ,
24
- Description : "The id of the cloud account the region belongs to." ,
21
+ Type : schema .TypeString ,
22
+ Optional : true ,
23
+ Computed : true ,
24
+ ConflictsWith : []string {"id" , "filter" },
25
+ Description : "The id of the cloud account the region belongs to." ,
26
+ RequiredWith : []string {"region" },
25
27
},
26
28
"created_at" : {
27
29
Type : schema .TypeString ,
@@ -34,15 +36,17 @@ func dataSourceRegion() *schema.Resource {
34
36
Description : "Unique identifier of region on the provider side." ,
35
37
},
36
38
"filter" : {
37
- Type : schema .TypeString ,
38
- Optional : true ,
39
- Description : "Search criteria to narrow down Regions." ,
39
+ Type : schema .TypeString ,
40
+ ConflictsWith : []string {"cloud_account_id" , "id" , "region" },
41
+ Optional : true ,
42
+ Description : "Search criteria to narrow down Regions." ,
40
43
},
41
44
"id" : {
42
- Type : schema .TypeString ,
43
- Optional : true ,
44
- Computed : true ,
45
- Description : "The id of the region instance." ,
45
+ Type : schema .TypeString ,
46
+ Optional : true ,
47
+ Computed : true ,
48
+ ConflictsWith : []string {"cloud_account_id" , "filter" , "region" },
49
+ Description : "The id of the region instance." ,
46
50
},
47
51
"name" : {
48
52
Type : schema .TypeString ,
@@ -60,9 +64,11 @@ func dataSourceRegion() *schema.Resource {
60
64
Description : "Email of the user that owns the entity." ,
61
65
},
62
66
"region" : {
63
- Type : schema .TypeString ,
64
- Optional : true ,
65
- Description : "The specific region associated with the cloud account. On vSphere, this is the external ID." ,
67
+ Type : schema .TypeString ,
68
+ Optional : true ,
69
+ ConflictsWith : []string {"id" , "filter" },
70
+ Description : "The specific region associated with the cloud account. On vSphere, this is the external ID." ,
71
+ RequiredWith : []string {"cloud_account_id" },
66
72
},
67
73
"updated_at" : {
68
74
Type : schema .TypeString ,
@@ -82,7 +88,7 @@ func dataSourceRegionRead(d *schema.ResourceData, meta interface{}) error {
82
88
id , idOk := d .GetOk ("id" )
83
89
84
90
if ! idOk && ! cloudAccountIDOk && ! regionOk && ! filterOk {
85
- return fmt .Errorf ("one of the following are required: (id, filter, region and cloudAccountId )" )
91
+ return fmt .Errorf ("one of the following are required: (`id`, ` filter`, or ` region` and `cloud_account_id` )" )
86
92
}
87
93
88
94
setFields := func (region * models.Region ) {
0 commit comments