/
data_source_volcengine_vpc_ipv6_gateways.go
108 lines (105 loc) · 3.1 KB
/
data_source_volcengine_vpc_ipv6_gateways.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package ipv6_gateway
import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
ve "github.com/volcengine/terraform-provider-volcengine/common"
)
func DataSourceVolcengineIpv6Gateways() *schema.Resource {
return &schema.Resource{
Read: dataSourceVolcengineIpv6GatewaysRead,
Schema: map[string]*schema.Schema{
"ids": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Set: schema.HashString,
Description: "The ID list of the Ipv6Gateways.",
},
"name": {
Type: schema.TypeString,
Optional: true,
Description: "The name of the Ipv6Gateway.",
},
"vpc_ids": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Set: schema.HashString,
Description: "The ID list of the VPC which the Ipv6Gateway belongs to.",
},
"name_regex": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringIsValidRegExp,
Description: "A Name Regex of the Ipv6Gateway.",
},
"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 Ipv6Gateway query.",
},
"ipv6_gateways": {
Description: "The collection of Ipv6Gateway query.",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "The ID of the Ipv6Gateway.",
},
"ipv6_gateway_id": {
Type: schema.TypeString,
Computed: true,
Description: "The ID of the Ipv6Gateway.",
},
"name": {
Type: schema.TypeString,
Computed: true,
Description: "The Name of the Ipv6Gateway.",
},
"description": {
Type: schema.TypeString,
Computed: true,
Description: "The description of the Ipv6Gateway.",
},
"vpc_id": {
Type: schema.TypeString,
Computed: true,
Description: "The id of the VPC which the Ipv6Gateway belongs to.",
},
"status": {
Type: schema.TypeString,
Computed: true,
Description: "The Status of the Ipv6Gateway.",
},
"creation_time": {
Type: schema.TypeString,
Computed: true,
Description: "Creation time of the Ipv6Gateway.",
},
"update_time": {
Type: schema.TypeString,
Computed: true,
Description: "Update time of the Ipv6Gateway.",
},
},
},
},
},
}
}
func dataSourceVolcengineIpv6GatewaysRead(d *schema.ResourceData, meta interface{}) error {
ipv6GatewayService := NewIpv6GatewayService(meta.(*ve.SdkClient))
return ipv6GatewayService.Dispatcher.Data(ipv6GatewayService, d, DataSourceVolcengineIpv6Gateways())
}