-
Notifications
You must be signed in to change notification settings - Fork 9
/
data_source_volcengine_rds_mssql_regions.go
48 lines (45 loc) · 1.34 KB
/
data_source_volcengine_rds_mssql_regions.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
package rds_mssql_region
import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
ve "github.com/volcengine/terraform-provider-volcengine/common"
)
func DataSourceVolcengineRdsMssqlRegions() *schema.Resource {
return &schema.Resource{
Read: dataSourceVolcengineRdsMssqlRegionsRead,
Schema: map[string]*schema.Schema{
"output_file": {
Type: schema.TypeString,
Optional: true,
Description: "File name where to save data source results.",
},
"total_count": {
Type: schema.TypeInt,
Computed: true,
Description: "The total count of region query.",
},
"regions": {
Description: "The collection of region query.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"region_id": {
Type: schema.TypeString,
Computed: true,
Description: "The id of the region.",
},
"region_name": {
Type: schema.TypeString,
Computed: true,
Description: "The name of region.",
},
},
},
},
},
}
}
func dataSourceVolcengineRdsMssqlRegionsRead(d *schema.ResourceData, meta interface{}) error {
regionService := NewRegionService(meta.(*ve.SdkClient))
return ve.DefaultDispatcher().Data(regionService, d, DataSourceVolcengineRdsMssqlRegions())
}