ec2

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

README

AWS EC2

The AWS EC2 plugin deploys an AWS AMI as a virtual machine, running on AWS EC2.

Components

  1. Platform
  1. AWS AMI
  2. AWS ALB

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_waypoint_builtin_aws_ec2_plugin_proto protoreflect.FileDescriptor
View Source
var Options = []sdk.Option{
	sdk.WithComponents(&Platform{}),
}

Options are the SDK options to use for instantiation.

Functions

func UserData

func UserData(env map[string]string) (string, error)

Types

type Deployment

type Deployment struct {
	ServiceName    string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	Region         string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
	PublicIp       string `protobuf:"bytes,3,opt,name=public_ip,json=publicIp,proto3" json:"public_ip,omitempty"`
	PublicDns      string `protobuf:"bytes,4,opt,name=public_dns,json=publicDns,proto3" json:"public_dns,omitempty"`
	TargetGroupArn string `protobuf:"bytes,5,opt,name=target_group_arn,json=targetGroupArn,proto3" json:"target_group_arn,omitempty"`
	// contains filtered or unexported fields
}

func (*Deployment) Descriptor deprecated

func (*Deployment) Descriptor() ([]byte, []int)

Deprecated: Use Deployment.ProtoReflect.Descriptor instead.

func (*Deployment) GetPublicDns

func (x *Deployment) GetPublicDns() string

func (*Deployment) GetPublicIp

func (x *Deployment) GetPublicIp() string

func (*Deployment) GetRegion

func (x *Deployment) GetRegion() string

func (*Deployment) GetServiceName

func (x *Deployment) GetServiceName() string

func (*Deployment) GetTargetGroupArn

func (x *Deployment) GetTargetGroupArn() string

func (*Deployment) ProtoMessage

func (*Deployment) ProtoMessage()

func (*Deployment) ProtoReflect

func (x *Deployment) ProtoReflect() protoreflect.Message

func (*Deployment) Reset

func (x *Deployment) Reset()

func (*Deployment) String

func (x *Deployment) String() string

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

Platform is the Platform implementation for Amazon EC2.

func (*Platform) Auth

func (p *Platform) Auth() error

func (*Platform) AuthFunc

func (p *Platform) AuthFunc() interface{}

AuthFunc implements component.Authenticator

func (*Platform) Config

func (p *Platform) Config() (interface{}, error)

Config implements Configurable

func (*Platform) Deploy

func (p *Platform) Deploy(
	ctx context.Context,
	log hclog.Logger,
	src *component.Source,
	job *component.JobInfo,
	img *ami.Image,
	deployConfig *component.DeploymentConfig,
	ui terminal.UI,
) (*Deployment, error)

Deploy deploys an image to Amazon EC2.

func (*Platform) DeployFunc

func (p *Platform) DeployFunc() interface{}

DeployFunc implements component.Platform

func (*Platform) Destroy

func (p *Platform) Destroy(
	ctx context.Context,
	log hclog.Logger,
	deployment *Deployment,
	ui terminal.UI,
) error

Destroy deletes the EC2 deployment.

func (*Platform) DestroyFunc

func (p *Platform) DestroyFunc() interface{}

DestroyFunc implements component.Destroyer

func (*Platform) Documentation

func (p *Platform) Documentation() (*docs.Documentation, error)

func (*Platform) ValidateAuth

func (p *Platform) ValidateAuth() error

func (*Platform) ValidateAuthFunc

func (p *Platform) ValidateAuthFunc() interface{}

ValidateAuthFunc implements component.Authenticator

type PlatformConfig

type PlatformConfig struct {
	// AWS region to operate in
	Region string `hcl:"region"`

	Count *countConfig `hcl:"count,block"`

	// The type of instance to create
	InstanceType string `hcl:"instance_type"`

	// The key to associate with the instance
	Key string `hcl:"key,optional"`

	// The port that the service runs on within the instance.
	ServicePort int `hcl:"service_port"`

	// Additional ports to allow into the instance
	ExtraPorts []int `hcl:"extra_ports,optional"`

	// Additional security groups to add to the EC2 instance.
	SecurityGroups []string `hcl:"security_groups,optional"`

	// Subnet to put the instance into. Defaults to a public subnet in the default VPC.
	Subnet string `hcl:"subnet,optional"`
}

Config is the configuration structure for the Platform.

Jump to

Keyboard shortcuts

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