helpers

package
v0.0.0-...-3e288c8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectRemote

func ConnectRemote(conf *config.Config, instance *structures.EC2Instance, keyPair *structures.KeyPair, username string) (*ssh.Client, error)

func CreateEC2Instance

func CreateEC2Instance(ec2Client *ec2.EC2, name, imageId, keyPairName, instanceType, securityGroupId, subnetId, userdata string) (*structures.EC2Instance, error)

func CreateKeyPair

func CreateKeyPair(ec2Client *ec2.EC2, name string, saveAsFile bool) (*structures.KeyPair, error)

func CreateSecurityGroup

func CreateSecurityGroup(ec2Client *ec2.EC2, name, vpcId string) (*structures.SecurityGroup, error)

TODO: En el Input de Create Security Group falta un Tag Specification

TagSpecifications = [
	{
		"ResourceType": "security-group",
		"Tags": [{"Key": "Name", "Value": name}],
	},
],

func DeleteKeyPair

func DeleteKeyPair(conf *config.Config, ec2Client *ec2.EC2, keyPairName, keyPairId string) error

func DeleteSecurityGroup

func DeleteSecurityGroup(conf *config.Config, ec2Client *ec2.EC2, groupId string) error

func DeployResourceStack

func DeployResourceStack(conf *config.Config, ec2Client *ec2.EC2, definition structures.StackDefinition) (*structures.Stack, error)

func ExecuteRemote

func ExecuteRemote(conf *config.Config, client *ssh.Client, cmd string) string

func GetDefaultUserdata

func GetDefaultUserdata() string

func GetNetworkResources

func GetNetworkResources(ec2Client *ec2.EC2) (*string, *string, error)

func InputContextToB64

func InputContextToB64(context structures.InputContext) (string, error)

func NewProcess

func NewProcess(ctx context.Context, dbClient *ent.Client, definition *structures.ProcessDefinition) (*structures.Process, error)

func ObscureMiddleString

func ObscureMiddleString(val string, edgeSize int, maxMiddle int, obsChar string) string

func ObscureProcess

func ObscureProcess(process *structures.Process) (*structures.Process, error)
func PrintLogo(url string)

func PurgeStack

func PurgeStack(ctx context.Context, dbClient *ent.Client, config *config.Config, ec2Client *ec2.EC2, id string) error

func StartNewProcess

func StartNewProcess(ctx context.Context, dbClient *ent.Client, conf *config.Config, ec2Client *ec2.EC2, definition *structures.ProcessDefinition, sync bool) (*structures.Process, error)

func StopAndDestroyProcess

func StopAndDestroyProcess(ctx context.Context, dbClient *ent.Client, config *config.Config, ec2Client *ec2.EC2, id string) (*structures.Process, error)

func TerminateInstance

func TerminateInstance(conf *config.Config, ec2Client *ec2.EC2, instanceId string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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