Documentation
¶
Overview ¶
Package cloud is the resource module for cloud-side provisioning.
These endpoints provision real resources in AWS/GCP/Azure, NOT on the SSH-into-VM path that install/ and deploy/ use. Examples:
- S3 buckets, GCS buckets
- IAM roles and policies
- VPCs and subnets
- EC2 / Compute Engine instances
- RDS / Cloud SQL instances
- Lambda / Cloud Functions
- EKS / GKE clusters
Backed by /api/v2/tenant/provision/* on the tenant node, which in turn runs Terraform server-side.
Index ¶
- type ActionInput
- type Client
- type DBOpts
- type Database
- func (d *Database) CreateAurora(ctx context.Context, name, region string, opts DBOpts) (*Result, error)
- func (d *Database) CreateRDS(ctx context.Context, name, region string, opts DBOpts) (*Result, error)
- func (d *Database) CreateRedis(ctx context.Context, name, region string, opts DBOpts) (*Result, error)
- type IAM
- type Kubernetes
- type Network
- type Result
- type S3
- type Serverless
- type StatusInput
- type VM
- type VMOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionInput ¶
type ActionInput struct {
// InstanceID is the cloud provider's instance identifier. Required.
InstanceID string
// Action is one of "start", "stop", "restart", "reboot". Required.
Action string
// Cloud is the provider ("aws" | "gcp" | "azure"). Defaults to "aws".
Cloud string
}
ActionInput describes a VM lifecycle action.
type Client ¶
Client is the cloud facade.
func (*Client) Kubernetes ¶
func (c *Client) Kubernetes() *Kubernetes
Kubernetes returns the EKS / GKE sub-client.
func (*Client) Serverless ¶
func (c *Client) Serverless() *Serverless
Serverless returns the Lambda / Cloud Functions sub-client.
type DBOpts ¶
type DBOpts struct {
Engine string // "postgres" | "postgresql" | "mysql" | "mariadb"
EngineVersion string
InstanceClass string
StorageGB int
Username string
Password string
DBName string
Port int
VPCID string
SubnetIDs []string
AllowedSecurityGroupIDs []string
VPCSecurityGroupIDs []string
InstanceCount int
NodeType string
NumCacheNodes int
PubliclyAccessible bool
MultiAZ bool
BackupRetention int
Encryption bool
}
DBOpts describes a managed database provision request.
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) CreateAurora ¶
func (d *Database) CreateAurora(ctx context.Context, name, region string, opts DBOpts) (*Result, error)
CreateAurora provisions an Aurora cluster. Pass at least two SubnetIDs.
type IAM ¶
type IAM struct {
// contains filtered or unexported fields
}
func (*IAM) CreateKeypair ¶
CreateKeypair provisions an EC2 key pair. The private key is stored in the workspace vault under the given name; the public material is uploaded to AWS.
type Kubernetes ¶
type Kubernetes struct {
// contains filtered or unexported fields
}
func (*Kubernetes) CreateCluster ¶
func (k *Kubernetes) CreateCluster(ctx context.Context, name, cloud, region string) (*Result, error)
CreateCluster provisions a managed Kubernetes cluster.
type Result ¶
type Result struct {
SessionID string `json:"session_id"`
Status string `json:"status,omitempty"`
ResourceName string `json:"resource_name,omitempty"`
ARN string `json:"arn,omitempty"`
BucketName string `json:"bucket_name,omitempty"`
InstanceID string `json:"instance_id,omitempty"`
ExecutionTime string `json:"execution_time,omitempty"`
StatePath string `json:"state_path,omitempty"`
TerraformOutputs map[string]interface{} `json:"terraform_outputs,omitempty"`
}
Result is what every cloud provisioning endpoint returns.
type Serverless ¶
type Serverless struct {
// contains filtered or unexported fields
}
func (*Serverless) CreateFunction ¶
func (s *Serverless) CreateFunction(ctx context.Context, name, cloud, region, runtime string) (*Result, error)
CreateFunction provisions a serverless function.
type StatusInput ¶
type StatusInput struct {
// InstanceID is the cloud provider's instance identifier (e.g. an
// AWS EC2 instance id). Required.
InstanceID string
// Cloud is the provider ("aws" | "gcp" | "azure"). Defaults to "aws".
Cloud string
}
StatusInput describes a VM status lookup.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
func (*VM) Action ¶
Action issues a lifecycle action against a previously-provisioned VM. Valid actions are "start", "stop", "restart", and "reboot" — anything else returns a ValidationError before any network round-trip.
Maps to POST {NodeURL}/api/v2/provision/vm/action.