compute

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputHost        string = "Host"
	OutputUsername    string = "Username"
	OutputPrivateKey  string = "PrivateKey"
	OutputPasswordKey string = "Password"

	DefaultRootBlockDeviceName string = "/dev/sda1"
	DefaultRootBlockDeviceSize int    = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Compute

type Compute struct {
	Specs      *supportMatrix.SupportedHost
	Name       string
	Username   string
	Instance   *ec2.Instance
	InstanceIP pulumi.StringOutput
	AWSKeyPair *ec2.KeyPair
	SG         []*ec2.SecurityGroup
	// contains value if key is created within this module
	PrivateKey *tls.PrivateKey
}

Related resources created within the compute asset

type ComputeRequest

type ComputeRequest interface {
	// Get Request information
	GetRequest() *Request
	// Get ami value for the compute
	GetAMI(ctx *pulumi.Context) (*ec2.LookupAmiResult, error)
	// Get userdata if any
	GetUserdata(ctx *pulumi.Context) (pulumi.StringPtrInput, error)
	// Create dedicated host if compute requires it
	GetDedicatedHost(ctx *pulumi.Context) (*ec2.DedicatedHost, error)
	// In case a host has any specific ingress rule, this ingress rule will take effect on a SG
	// with egress to all in case of specific SG it is required to define them within CustomSecurityGroups
	CustomIngressRules() []securityGroup.IngressRules
	CustomSecurityGroups(ctx *pulumi.Context) ([]*ec2.SecurityGroup, error)
	// Get script to be executed after initalization (not suited for userdata)
	GetPostScript(ctx *pulumi.Context) (pulumi.StringPtrInput, error)
	// Command to be executed to ensure the provisioned is finish with fully setup
	ReadinessCommand() string
	// Create function to get a compute based on request
	Create(ctx *pulumi.Context, computeRequested ComputeRequest) (*Compute, error)
}

Methods to be implemented by any specific type of compute supported these methods implement specifics on each different type

type Request

type Request struct {
	ProjecName string
	Specs      *supportMatrix.SupportedHost
	Public     bool
	BastionSG  *ec2.SecurityGroup
	KeyPair    *ec2.KeyPair
	// contains value if key is created within this module
	PublicKeyOpenssh  pulumi.StringOutput
	VPC               *ec2.Vpc
	AvailabilityZones []string
	Region            string
	Subnets           []*ec2.Subnet
	SpotPrice         string
}

Composable resources and information provided to create a compute asset

func (*Request) Create

func (r *Request) Create(ctx *pulumi.Context, computeRequested ComputeRequest) (*Compute, error)

func (*Request) CustomIngressRules

func (r *Request) CustomIngressRules() []securityGroup.IngressRules

func (*Request) CustomSecurityGroups

func (r *Request) CustomSecurityGroups(ctx *pulumi.Context) ([]*ec2.SecurityGroup, error)

func (*Request) GetAMI

func (r *Request) GetAMI(ctx *pulumi.Context) (*ec2.LookupAmiResult, error)

func (*Request) GetDedicatedHost

func (r *Request) GetDedicatedHost(ctx *pulumi.Context) (*ec2.DedicatedHost, error)

func (*Request) GetName

func (r *Request) GetName() string

func (*Request) GetPostScript

func (r *Request) GetPostScript(ctx *pulumi.Context) (pulumi.StringPtrInput, error)

func (*Request) GetRequest added in v0.0.2

func (r *Request) GetRequest() *Request

func (*Request) GetUserdata added in v0.0.2

func (r *Request) GetUserdata(ctx *pulumi.Context) (pulumi.StringPtrInput, error)

func (*Request) OutputHost added in v0.0.2

func (r *Request) OutputHost() string

func (*Request) OutputPassword added in v0.0.2

func (r *Request) OutputPassword() string

func (*Request) OutputPrivateKey added in v0.0.2

func (r *Request) OutputPrivateKey() string

func (*Request) OutputUsername added in v0.0.2

func (r *Request) OutputUsername() string

func (*Request) ReadinessCommand added in v0.0.2

func (r *Request) ReadinessCommand() string

Directories

Path Synopsis
host
services
snc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL