This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
schema_gcp.go
107 lines (104 loc) · 3.38 KB
/
schema_gcp.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
package shoot
import "github.com/hashicorp/terraform/helper/schema"
func gcpControlPlaneResource() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"zone": {
Type: schema.TypeString,
Description: "Zone is the GCP zone.",
Required: true,
},
},
}
}
func gcpResource() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"networks": {
Type: schema.TypeList,
Description: "Networks is the network configuration (VPC, subnets, etc.)",
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"vpc": {
Type: schema.TypeList,
Description: "VPC indicates whether to use an existing VPC or create a new one.",
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Description: "Name is the VPC name.",
Optional: true,
},
"cloud_router": {
Type: schema.TypeList,
Description: "CloudRouter indicates whether to use an existing CloudRouter or create a new one.",
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Description: "Name is the CloudRouter name.",
Optional: true,
},
},
},
},
},
},
},
"cloud_nat": {
Type: schema.TypeList,
Description: "CloudNAT contains configuration about the the CloudNAT configuration",
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"min_ports_per_vm": {
Type: schema.TypeInt,
Description: "MinPortsPerVM is the minimum number of ports allocated to a VM in the NAT config. The default value is 2048 ports.",
Optional: true,
},
},
},
},
"internal": {
Type: schema.TypeString,
Description: "Internal is a private subnet (used for internal load balancers).",
Optional: true,
},
"workers": {
Type: schema.TypeString,
Description: "Workers is the worker subnet range to create (used for the VMs).",
Required: true,
},
"flow_logs": {
Type: schema.TypeList,
Description: "FlowLogs contains the flow log configuration for the subnet.",
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"aggregation_interval": {
Type: schema.TypeString,
Description: "AggregationInterval for collecting flow logs.",
Optional: true,
},
"flow_sampling": {
Type: schema.TypeFloat,
Description: "FlowSampling sets the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported.",
Optional: true,
},
"metadata": {
Type: schema.TypeString,
Description: "Metadata configures whether metadata fields should be added to the reported VPC flow logs.",
Optional: true,
},
},
},
},
},
},
},
},
}
}