diff --git a/configs/config.json b/configs/config.json index 0a50b10..b0a09fb 100644 --- a/configs/config.json +++ b/configs/config.json @@ -38,5 +38,45 @@ "username": "op", "password": "USER_PASSWORD" } - } + }, + "custom_vms": [ + { + "provider": "aws", + "instance_id": "i-customid", + "public_ip": "1.2.3.4", + "ssh_port": 22, + "username": "ec2-user", + "password": "USER_PASSWORD", + "key_path": "/path/to/your/private-key.pem", + "tags": [ + "web-server", + "production" + ] + }, + { + "provider": "utm", + "instance_id": "i-customid2", + "public_ip": "1.2.3.4", + "ssh_port": 22, + "username": "user", + "password": "USER_PASSWORD", + "key_path": "/path/to/your/private-key.pem", + "tags": [ + "test", + "production" + ] + }, + { + "provider": "virtualbox", + "instance_id": "i-customid3", + "public_ip": "1.2.3.4", + "ssh_port": 22, + "username": "user", + "password": "USER_PASSWORD", + "key_path": "/path/to/your/private-key.pem", + "tags": [ + "staging" + ] + } + ] } \ No newline at end of file diff --git a/pkg/models/config.go b/pkg/models/config.go index 35b80b3..1a72766 100644 --- a/pkg/models/config.go +++ b/pkg/models/config.go @@ -2,21 +2,33 @@ package models type Config struct { Providers map[string]Provider `json:"providers"` + CustomVMs []CustomVM `json:"custom_vms"` SSHKeys SSHKeys `json:"ssh_keys"` Settings Settings `json:"settings"` } type Provider struct { - Token string `json:"token"` - Region string `json:"region"` - Size string `json:"size"` - Image string `json:"image"` - Port int `json:"port"` - Username string `json:"username"` - Password string `json:"password"` + Token string `json:"token,omitempty"` + Region string `json:"region,omitempty"` + Size string `json:"size,omitempty"` + Image string `json:"image,omitempty"` + Port int `json:"port,omitempty"` + Username string `json:"username,omitempty"` + Password string `json:"password,omitempty"` Tags []string `json:"tags,omitempty"` } +type CustomVM struct { + Provider string `json:"provider"` + InstanceID string `json:"instance_id"` + PublicIP string `json:"public_ip"` + SSHPort int `json:"ssh_port"` + Username string `json:"username"` + Password string `json:"password"` + KeyPath string `json:"key_path"` + Tags []string `json:"tags"` +} + type SSHKeys struct { PublicFile string `json:"public_file"` PrivateFile string `json:"private_file"`