Documentation ¶
Index ¶
- Constants
- Variables
- func AssociateRouteTable(ec2Client *ec2.Client, subnetID string, routeTableID string) error
- func AttachElasticIPToInstance(ec2Client *ec2.Client, elasticIPId string, instanceId string) (string, error)
- func AttachInternetGatewayToVPC(ec2Client *ec2.Client, internetGatewayId string, VPCID string) error
- func CloseInstancePort(ec2Client *ec2.Client, securityGroupID string, portToClose string) error
- func CreateDynamoDBTableForYoloConfig(dynamoDBClient *dynamodb.Client) error
- func DetachElasticIPFromInstance(ec2Client *ec2.Client, elasticIPAssociationId string) error
- func DetachInternetGatewayFromVPC(ec2Client *ec2.Client, internetGatewayId string, VPCID string) error
- func LookupYoloConfigInDynamoDBTable(dynamoDBClient *dynamodb.Client) (returnedConfigJSON string, returnedError error)
- func OpenInstancePort(ec2Client *ec2.Client, securityGroupID string, portToOpen string) error
- func RemoveDynamoDBTableForYoloConfig(dynamoDBClient *dynamodb.Client) error
- func RemoveElasticIP(ec2Client *ec2.Client, elasticIPId string) error
- func RemoveInternetGateway(ec2Client *ec2.Client, internetGatewayId string) error
- func RemoveKeyPair(ec2Client *ec2.Client, keyPairID string) error
- func RemoveNetworkInterface(ec2Client *ec2.Client, networkInterfaceID string) error
- func RemoveRouteTable(ec2Client *ec2.Client, routeTableID string) error
- func RemoveSecurityGroup(ec2Client *ec2.Client, securityGroupID string) error
- func RemoveSubnet(ec2Client *ec2.Client, subnetID string) error
- func RemoveVPC(ec2Client *ec2.Client, VPCID string) error
- func TerminateInstance(ec2Client *ec2.Client, instanceID string) error
- func UpdateYoloConfigInDynamoDBTable(dynamoDBClient *dynamodb.Client, configID string, configJSON string) error
- func WaitForSSHAvailableInInstance(ec2Client *ec2.Client, instancePublicIPAddress string, instanceSSHPort string) (returnedError error)
- type AMI
- type AttachVolumeResp
- type CreateSnapshotForVolumeResp
- type CreateVolumeFromSnapshotResp
- type DetachVolumeResp
- type DynamoDBYoloConfigTableRecord
- type ElasticIP
- type InitInstanceScriptResults
- type Instance
- type InstanceTypeArch
- type InstanceTypeInfos
- type InstanceVolume
- type InternetGateway
- type KeyPair
- type NetworkInterface
- type RawInitInstanceScriptResults
- type RemoveVolumeResp
- type RemoveVolumeSnapshotResp
- type Route
- type RouteTable
- type SecurityGroup
- type Subnet
- type VPC
Constants ¶
View Source
const ( InstanceSSHPort = 22 InstanceRootUser = "ubuntu" )
View Source
const ( InstanceTypeArchArm64 = "arm64" InstanceTypeArchX8664 = "x86_64" )
View Source
const ( UbuntuAMIRootUser = "ubuntu" UbuntuAMINamePatternAmd64 = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*" UbuntuAMINamePatternArm64 = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-*" )
View Source
const DynamoDBYoloConfigTableName = "yolo-configuration-dynamodb-table"
View Source
const (
InstanceRootDeviceSizeGb = 16
)
Variables ¶
View Source
var ( ErrNoYoloConfigFound = errors.New("ErrNoYoloConfigFound") ErrMultipleYoloConfigFound = errors.New("ErrMultipleYoloConfigFound") )
View Source
var ( ErrInvalidInstanceType = errors.New("ErrInvalidInstanceType") ErrInvalidInstanceTypeArch = errors.New("ErrInvalidInstanceTypeArch") SupportedInstanceTypeArchs = []string{ string(InstanceTypeArchArm64), string(InstanceTypeArchX8664), } )
View Source
var (
ErrInstanceNotFound = errors.New("ErrInstanceNotFound")
)
View Source
var (
ErrYoloConfigTableAlreadyExists = errors.New("ErrYoloConfigTableAlreadyExists")
)
Functions ¶
func AssociateRouteTable ¶
func CloseInstancePort ¶
func OpenInstancePort ¶
func RemoveInternetGateway ¶
func RemoveNetworkInterface ¶
func RemoveSecurityGroup ¶
Types ¶
type AMI ¶
type AMI struct { ID string `json:"id"` RootUser string `json:"root_user"` RootDeviceName string `json:"root_device_name"` }
func LookupUbuntuAMIForArch ¶
func LookupUbuntuAMIForArch( ec2Client *ec2.Client, arch InstanceTypeArch, ) (returnedAMI *AMI, returnedError error)
type CreateSnapshotForVolumeResp ¶
func CreateSnapshotForVolume ¶
func CreateSnapshotForVolume( ec2Client *ec2.Client, name string, volumeID string, ) (resp CreateSnapshotForVolumeResp)
type ElasticIP ¶
type InitInstanceScriptResults ¶
type InitInstanceScriptResults struct { ExitCode string `json:"exit_code"` SSHHostKeys []entities.EnvSSHHostKey `json:"ssh_host_keys"` }
type Instance ¶
type Instance struct { ID string `json:"id"` Type string `json:"type"` TmpPublicIPAddress string `json:"tmp_public_ip_address"` Volumes []InstanceVolume `json:"volumes"` InitScriptResults *InitInstanceScriptResults `json:"init_script_results"` }
type InstanceTypeArch ¶
type InstanceTypeArch string
type InstanceTypeInfos ¶
type InstanceTypeInfos struct { Type string `json:"type"` Arch InstanceTypeArch `json:"arch"` }
func LookupInstanceTypeInfos ¶
func LookupInstanceTypeInfos( ec2Client *ec2.Client, instanceType string, ) (returnedInstanceTypeInfos *InstanceTypeInfos, returnedError error)
type InstanceVolume ¶
type InternetGateway ¶
type InternetGateway struct { ID string `json:"id"` IsAttachedToVPC bool `json:"is_attached_to_vpc"` }
func CreateInternetGateway ¶
func CreateInternetGateway( ec2Client *ec2.Client, name string, ) (returnedIG *InternetGateway, returnedError error)
type KeyPair ¶
type NetworkInterface ¶
type NetworkInterface struct {
ID string `json:"id"`
}
func CreateNetworkInterface ¶
type RemoveVolumeResp ¶
type RemoveVolumeResp struct {
Err error
}
func RemoveVolume ¶
func RemoveVolume( ec2Client *ec2.Client, volumeID string, ) (resp RemoveVolumeResp)
type RemoveVolumeSnapshotResp ¶
type RemoveVolumeSnapshotResp struct {
Err error
}
func RemoveVolumeSnapshot ¶
func RemoveVolumeSnapshot( ec2Client *ec2.Client, snapshotID string, ) (resp RemoveVolumeSnapshotResp)
type RouteTable ¶
type RouteTable struct { ID string `json:"id"` IsAssociatedToSubnet bool `json:"is_associated_to_subnet"` }
func CreateRouteTable ¶
type SecurityGroup ¶
type SecurityGroup struct {
ID string `json:"id"`
}
func CreateSecurityGroup ¶
func CreateSecurityGroup( ec2Client *ec2.Client, name string, description string, VPCID string, ingressPorts []types.IpPermission, ) (returnedSecurityGroup *SecurityGroup, returnedError error)
Source Files ¶
- associate_route_table.go
- attach_elastic_ip.go
- attach_internet_gateway.go
- close_instance_port.go
- create_dynamodb_table.go
- create_elastic_ip.go
- create_instance.go
- create_internet_gateway.go
- create_key_pair.go
- create_network_interface.go
- create_route.go
- create_route_table.go
- create_security_group.go
- create_subnet.go
- create_vpc.go
- detach_elastic_ip.go
- detach_internet_gateway.go
- get_most_recent_ami.go
- instance_ssh.go
- lookup_dynamodb_table_records.go
- lookup_instance.go
- lookup_instance_type_infos.go
- lookup_ubuntu_ami.go
- open_instance_port.go
- remove_dynamodb_table.go
- remove_elastic_ip.go
- remove_instance.go
- remove_internet_gateway.go
- remove_key_pair.go
- remove_network_interface.go
- remove_route_table.go
- remove_security_group.go
- remove_subnet.go
- remove_vpc.go
- update_dynamodb_table_records.go
- volume.go
Click to show internal directories.
Click to hide internal directories.