-
Notifications
You must be signed in to change notification settings - Fork 221
/
schema_node_template_linode.go
129 lines (122 loc) · 4.14 KB
/
schema_node_template_linode.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
package rancher2
import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
const (
linodeConfigDriver = "linode"
)
//Types
type linodeConfig struct {
AuthorizedUsers string `json:"authorizedUsers,omitempty" yaml:"authorizedUsers,omitempty"`
CreatePrivateIP bool `json:"createPrivateIp,omitempty" yaml:"createPrivateIp,omitempty"`
DockerPort string `json:"dockerPort,omitempty" yaml:"dockerPort,omitempty"`
Image string `json:"image,omitempty" yaml:"image,omitempty"`
InstanceType string `json:"instanceType,omitempty" yaml:"instanceType,omitempty"`
Label string `json:"label,omitempty" yaml:"label,omitempty"`
Region string `json:"region,omitempty" yaml:"region,omitempty"`
RootPass string `json:"rootPass,omitempty" yaml:"rootPass,omitempty"`
SSHPort string `json:"sshPort,omitempty" yaml:"sshPort,omitempty"`
SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"`
StackScript string `json:"stackscript,omitempty" yaml:"stackscript,omitempty"`
StackscriptData string `json:"stackscriptData,omitempty" yaml:"stackscriptData,omitempty"`
SwapSize string `json:"swapSize,omitempty" yaml:"swapSize,omitempty"`
Tags string `json:"tags,omitempty" yaml:"tags,omitempty"`
Token string `json:"token,omitempty" yaml:"token,omitempty"`
UAPrefix string `json:"uaPrefix,omitempty" yaml:"uaPrefix,omitempty"`
}
//Schemas
func linodeConfigFields() map[string]*schema.Schema {
s := map[string]*schema.Schema{
"authorized_users": {
Type: schema.TypeString,
Optional: true,
Sensitive: false,
Description: "Linode user accounts (seperated by commas) whose Linode SSH keys will be permitted root access to the created node",
},
"create_private_ip": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Create private IP for the instance",
},
"docker_port": {
Type: schema.TypeString,
Optional: true,
Default: "2376",
Description: "Docker Port",
},
"image": {
Type: schema.TypeString,
Optional: true,
Default: "linode/ubuntu18.04",
Description: "Specifies the Linode Instance image which determines the OS distribution and base files",
},
"instance_type": {
Type: schema.TypeString,
Optional: true,
Default: "g6-standard-4",
Description: "Specifies the Linode Instance type which determines CPU, memory, disk size, etc.",
},
"label": {
Type: schema.TypeString,
Optional: true,
Description: "Linode Instance Label",
},
"region": {
Type: schema.TypeString,
Optional: true,
Default: "us-east",
Description: "Specifies the region (location) of the Linode instance",
},
"root_pass": {
Type: schema.TypeString,
Optional: true,
Sensitive: true,
Description: "Root Password",
},
"ssh_port": {
Type: schema.TypeString,
Optional: true,
Default: "22",
Description: "Linode Instance SSH Port",
},
"ssh_user": {
Type: schema.TypeString,
Optional: true,
Description: "Specifies the user as which docker-machine should log in to the Linode instance to install Docker.",
},
"stackscript": {
Type: schema.TypeString,
Optional: true,
Description: "Specifies the Linode StackScript to use to create the instance",
},
"stackscript_data": {
Type: schema.TypeString,
Optional: true,
Description: "A JSON string specifying data for the selected StackScript",
},
"swap_size": {
Type: schema.TypeString,
Optional: true,
Default: "512",
Description: "Linode Instance Swap Size (MB)",
},
"tags": {
Type: schema.TypeString,
Optional: true,
Description: "A comma separated list of tags to apply to the the Linode resource",
},
"token": {
Type: schema.TypeString,
Optional: true,
Sensitive: true,
Description: "Linode API Token",
},
"ua_prefix": {
Type: schema.TypeString,
Optional: true,
Description: "Prefix the User-Agent in Linode API calls with some 'product/version'",
},
}
return s
}