aws

package
v0.0.0-...-d252298 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeSSH

func AuthorizeSSH(groupName string, tag types.Tag, api AuthorizeSecurityGroupApi) error

func CreateEC2

func CreateEC2(runId, instanceType, iam, bucketName, accountId string, tag types.Tag, api Ec2Api) (string, error)

func CreateKeyPair

func CreateKeyPair(keyName string, tag types.Tag, api KeyPairApi) ([]byte, error)

func CreateS3

func CreateS3(req AwsSetupRequest) (string, error)

func CreateSecurityGroup

func CreateSecurityGroup(groupName string, tag types.Tag, api SecurityGroupApi) error

func DeleteEc2

func DeleteEc2(runIds []string, api Ec2Api) error

func DeleteKeyPairs

func DeleteKeyPairs(keyNames []string, api KeyPairApi) error

func DeleteSecurityGroups

func DeleteSecurityGroups(groupNames []string, api SecurityGroupApi) error

func DestroyAws

func DestroyAws(req AwsDestroyRequest) error

deletes resoures created by the user

func StartVm

func StartVm(req AwsSetupRequest) (*tinycloud.Vm, error)

Types

type AuthorizeSecurityGroupApi

type AuthorizeSecurityGroupApi interface {
	AuthorizeSecurityGroupIngress(ctx context.Context,
		params *ec2.AuthorizeSecurityGroupIngressInput,
		optFns ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)
}

type AwsDestroyRequest

type AwsDestroyRequest struct {
	ProfileName      string
	Region           string
	AccessKeyId      string
	SeacretAccessKey string
	RunIds           []string
}

DELETE AWS VM

type AwsSetupRequest

type AwsSetupRequest struct {
	ProfileName      string
	Region           string
	AccessKeyId      string
	SeacretAccessKey string
	InstanceType     string
	Iam              string
	BucketName       string
	AccountId        string
}

type Ec2Api

type Ec2Api interface {
	RunInstances(ctx context.Context,
		params *ec2.RunInstancesInput,
		optFns ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error)

	DescribeInstanceStatus(ctx context.Context,
		params *ec2.DescribeInstanceStatusInput,
		optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceStatusOutput, error)

	DescribeInstances(ctx context.Context,
		params *ec2.DescribeInstancesInput,
		optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)

	TerminateInstances(ctx context.Context,
		params *ec2.TerminateInstancesInput,
		optFns ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)
}

type KeyPairApi

type KeyPairApi interface {
	CreateKeyPair(ctx context.Context,
		params *ec2.CreateKeyPairInput,
		optFns ...func(*ec2.Options)) (*ec2.CreateKeyPairOutput, error)
	DeleteKeyPair(ctx context.Context,
		params *ec2.DeleteKeyPairInput,
		optFns ...func(*ec2.Options)) (*ec2.DeleteKeyPairOutput, error)
}

type SecurityGroupApi

type SecurityGroupApi interface {
	CreateSecurityGroup(ctx context.Context,
		params *ec2.CreateSecurityGroupInput,
		optFns ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)
	DeleteSecurityGroup(ctx context.Context,
		params *ec2.DeleteSecurityGroupInput,
		optFns ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)
}

Jump to

Keyboard shortcuts

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