Documentation
¶
Index ¶
- Variables
- func Setup(awsConfig aws.Config)
- type ACM
- type AttachDomainsToLoadBalancerOptions
- type AwsumILBService
- type CreateInstanceTargetGroupOptions
- type EC2
- func (svc *EC2) Client() *ec2.Client
- func (svc *EC2) CreateEmptySecurityGroup(ctx context.Context, name string) (*ec2.CreateSecurityGroupOutput, error)
- func (svc *EC2) GetAllRunningInstances(ctx context.Context) ([]*Instance, error)
- func (svc *EC2) GetAllSecurityGroupRules(ctx context.Context) ([]types.SecurityGroupRule, error)
- func (svc *EC2) GetAllSubnets(ctx context.Context) ([]types.Subnet, error)
- func (svc *EC2) GetAllVPCs(ctx context.Context, vpcIds ...string) ([]types.Vpc, error)
- func (svc *EC2) SearchForSecurityGroupByName(ctx context.Context, name string) (*types.SecurityGroup, error)
- type ELBv2
- func (svc *ELBv2) Client() *elbv2.Client
- func (svc *ELBv2) DeleteAllListenersInLoadBalancer(ctx context.Context, loadBalancerArn string) error
- func (svc *ELBv2) DeregisterAllTargetsInTargetGroup(ctx context.Context, targetGroupArn string) error
- func (svc *ELBv2) GenerateAwsumServiceName(serviceName string) string
- func (svc *ELBv2) GetAllListenersInLoadBalancer(ctx context.Context, loadBalancerArn string) ([]types.Listener, error)
- func (svc *ELBv2) SearchForLoadBalancerByName(ctx context.Context, name string) (*types.LoadBalancer, error)
- func (svc *ELBv2) SearchForTargetGroupByName(ctx context.Context, name string) (*types.TargetGroup, error)
- type ILBServiceResources
- type Instance
- func (i *Instance) AttachShell(sshUser string) error
- func (i *Instance) DialSSH(user string) (*ssh.Client, error)
- func (i *Instance) GenerateSSHClientConfigFromAssumedUserKey(user string) (*ssh.ClientConfig, error)
- func (i *Instance) GetFormattedBestIpAddress() string
- func (i *Instance) GetFormattedType() string
- func (i *Instance) GetName() string
- func (i *Instance) RunCommand(sshUser string, command string, quiet bool) error
- type InstanceFilters
- type Route53
- func (svc *Route53) AttachDomainsToLoadBalancer(opts AttachDomainsToLoadBalancerOptions) error
- func (svc *Route53) Client() *route53.Client
- func (svc *Route53) GetAllHostedZoneARecords(ctx context.Context, hostedZoneId string) ([]types.ResourceRecordSet, error)
- func (svc *Route53) GetAllHostedZones(ctx context.Context) ([]types.HostedZone, error)
- func (svc *Route53) GetAssumedHostedZoneByDomainName(ctx context.Context, domainName string, private bool) (*types.HostedZone, error)
- type SetupNewILBServiceOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrTargetGroupNotReturnedAfterCreation = errors.New("target group not returned after creation") ErrTargetInstancesMustAllBeInSameVPC = errors.New("target instances must all be in the same vpc") )
var ( DefaultEC2 *EC2 DefaultELBv2 *ELBv2 DefaultACM *ACM DefaultRoute53 *Route53 DefaultAwsumILB *AwsumILBService )
Functions ¶
Types ¶
type ACM ¶
type ACM struct {
// contains filtered or unexported fields
}
type AttachDomainsToLoadBalancerOptions ¶ added in v1.1.3
type AwsumILBService ¶
AwsumILBService is a struct used to encompass all the logic of services on instances that are load balanced by resources created by awsum.
func NewAwsumILBService ¶
func NewAwsumILBService(awsConfig aws.Config) *AwsumILBService
func (*AwsumILBService) SetupNewILBService ¶
func (svc *AwsumILBService) SetupNewILBService(opts SetupNewILBServiceOptions) (*ILBServiceResources, error)
type EC2 ¶
type EC2 struct {
// contains filtered or unexported fields
}
func (*EC2) CreateEmptySecurityGroup ¶
func (*EC2) GetAllRunningInstances ¶
func (*EC2) GetAllSecurityGroupRules ¶
func (*EC2) GetAllSubnets ¶
func (*EC2) GetAllVPCs ¶
func (*EC2) SearchForSecurityGroupByName ¶
func (svc *EC2) SearchForSecurityGroupByName(ctx context.Context, name string) (*types.SecurityGroup, error)
SearchForSecurityGroupByName will return a security group matching the name given, if there are no matches then it will return a nil pointer and a nil error.
type ELBv2 ¶
type ELBv2 struct {
// contains filtered or unexported fields
}
func (*ELBv2) DeleteAllListenersInLoadBalancer ¶
func (*ELBv2) DeregisterAllTargetsInTargetGroup ¶
func (*ELBv2) GenerateAwsumServiceName ¶
func (*ELBv2) GetAllListenersInLoadBalancer ¶
func (*ELBv2) SearchForLoadBalancerByName ¶
func (*ELBv2) SearchForTargetGroupByName ¶
type ILBServiceResources ¶
type Instance ¶
func NewInstanceFromEC2 ¶
func (*Instance) AttachShell ¶
func (*Instance) GenerateSSHClientConfigFromAssumedUserKey ¶
func (i *Instance) GenerateSSHClientConfigFromAssumedUserKey(user string) (*ssh.ClientConfig, error)
GenerateSSHClientConfigFromAssumedUserKey generates an ssh client config with keys from the user's ssh directory. Assumed to be '~/.ssh'. The given user will be used in authentication.
func (*Instance) GetFormattedBestIpAddress ¶
GetFormattedBestIpAddress returns a string containing the 'best' ip address to display for the instance. By 'best', meaning return the EC2 instance's public ip address if it is available, if not, return the private ip address.
func (*Instance) GetFormattedType ¶
type InstanceFilters ¶
type InstanceFilters struct {
Name string
}
func (InstanceFilters) DoesMatch ¶
func (f InstanceFilters) DoesMatch(instance *Instance) bool
func (InstanceFilters) Matches ¶
func (f InstanceFilters) Matches(instances []*Instance) []*Instance
type Route53 ¶ added in v1.1.3
type Route53 struct {
// contains filtered or unexported fields
}
func NewRoute53 ¶ added in v1.1.3
func (*Route53) AttachDomainsToLoadBalancer ¶ added in v1.1.3
func (svc *Route53) AttachDomainsToLoadBalancer(opts AttachDomainsToLoadBalancerOptions) error
func (*Route53) GetAllHostedZoneARecords ¶ added in v1.1.3
func (*Route53) GetAllHostedZones ¶ added in v1.1.3
func (*Route53) GetAssumedHostedZoneByDomainName ¶ added in v1.1.3
type SetupNewILBServiceOptions ¶
type SetupNewILBServiceOptions struct {
Ctx context.Context
ServiceName string
TargetInstanceFilters InstanceFilters
LoadBalancerListenerProtocol types.ProtocolEnum
LoadBalancerIpProtocol string
LoadBalancerPort int32
TrafficPort int32
TrafficProtocol types.ProtocolEnum
CertificateNames []string
DomainNames []string
Private bool
}
func (SetupNewILBServiceOptions) AwsumResourceName ¶
func (opts SetupNewILBServiceOptions) AwsumResourceName() string