Documentation ¶
Index ¶
- func DescribeInstanceById(client *ec2.EC2, instanceId string) (*ec2.Instance, error)
- func NewSpotRequestFailedError(code string) error
- type NetworkSvc
- func (svc *NetworkSvc) DeleteNetworkInterface(nicId string) error
- func (svc *NetworkSvc) GetSubnetCidr(subnetId string) (string, error)
- func (svc *NetworkSvc) GetSubnetsById(subnetIds []string) ([]*ec2.Subnet, error)
- func (svc *NetworkSvc) GetUnusedNetworkInterfaces(vpcId string, securityGroupIds []string, tagsFilter map[string][]string) ([]string, error)
- func (svc *NetworkSvc) GetVpcDefaultSecurityGroup(vpcId string) (string, error)
- func (svc *NetworkSvc) RouteTableAvailable(routeTableId, vpcId string) (bool, error)
- func (svc *NetworkSvc) SubnetAvailable(subnetId, vpcId string) (bool, error)
- func (svc *NetworkSvc) VpcAvailable(vpcId string) (bool, error)
- type SpotInstanceRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribeInstanceById ¶
DescribeInstanceById returns detailed information about the instance
func NewSpotRequestFailedError ¶
NewSpotRequestFailedError creates a new errSpotRequestFailed
Types ¶
type NetworkSvc ¶
type NetworkSvc struct {
// contains filtered or unexported fields
}
NetworkSvc describes the fields needed to interact with EC2 to perform network related operations
func NewNetworkSvc ¶
func NewNetworkSvc(ec2Api ec2iface.EC2API, logger logur.Logger) *NetworkSvc
NewNetworkSvc instantiates a new NetworkSvc that uses the provided ec2 api to perform network related operations
func (*NetworkSvc) DeleteNetworkInterface ¶
func (svc *NetworkSvc) DeleteNetworkInterface(nicId string) error
DeleteNetworkInterface deletes the network interface with the given id
func (*NetworkSvc) GetSubnetCidr ¶
func (svc *NetworkSvc) GetSubnetCidr(subnetId string) (string, error)
GetSubnetCidr returns the cidr of the subnet
func (*NetworkSvc) GetSubnetsById ¶
func (svc *NetworkSvc) GetSubnetsById(subnetIds []string) ([]*ec2.Subnet, error)
GetSubnetsById returns the subnets identified by the provided in subnet ids
func (*NetworkSvc) GetUnusedNetworkInterfaces ¶
func (svc *NetworkSvc) GetUnusedNetworkInterfaces(vpcId string, securityGroupIds []string, tagsFilter map[string][]string) ([]string, error)
GetUnusedNetworkInterfaces returns network interfaces that are not in "in-use" state of the specified VPC which are associated with the specified security groups and matches the tagsFilter if provided
func (*NetworkSvc) GetVpcDefaultSecurityGroup ¶
func (svc *NetworkSvc) GetVpcDefaultSecurityGroup(vpcId string) (string, error)
GetVpcDefaultSecurityGroup returns the Id of default security group of the VPC
func (*NetworkSvc) RouteTableAvailable ¶
func (svc *NetworkSvc) RouteTableAvailable(routeTableId, vpcId string) (bool, error)
RouteTableAvailable returns true if there is an 'active' route table with the given id and belongs to the VPC with the given id.
func (*NetworkSvc) SubnetAvailable ¶
func (svc *NetworkSvc) SubnetAvailable(subnetId, vpcId string) (bool, error)
SubnetAvailable returns true if the Subnet with given id exists and belongs to the VPC with the given id.
func (*NetworkSvc) VpcAvailable ¶
func (svc *NetworkSvc) VpcAvailable(vpcId string) (bool, error)
VpcAvailable returns true of the VPC with the given id exists, and is in available state otherwise false
type SpotInstanceRequest ¶
type SpotInstanceRequest struct {
*ec2.SpotInstanceRequest
}
SpotInstanceRequest extends ec2.SpotInstanceRequest
func NewSpotInstanceRequest ¶
func NewSpotInstanceRequest(request *ec2.SpotInstanceRequest) *SpotInstanceRequest
NewSpotInstanceRequest initialises and gives back a SpotInstanceRequest
func (*SpotInstanceRequest) GetState ¶
func (r *SpotInstanceRequest) GetState() string
GetState gives back the state of the request
func (*SpotInstanceRequest) GetStatusCode ¶
func (r *SpotInstanceRequest) GetStatusCode() string
GetStatusCode gives back the status code of the request
func (*SpotInstanceRequest) IsActive ¶
func (r *SpotInstanceRequest) IsActive() bool
IsActive is true if the request is an active one
func (*SpotInstanceRequest) IsFulfilled ¶
func (r *SpotInstanceRequest) IsFulfilled() bool
IsFullfilled is true if the request is fulfilled
func (*SpotInstanceRequest) IsPending ¶
func (r *SpotInstanceRequest) IsPending() bool
IsPending is true if the request is in a pending state
func (*SpotInstanceRequest) IsPipelineRelated ¶
func (r *SpotInstanceRequest) IsPipelineRelated() bool
IsPipelineRelated checks whether the spot request has a tag which indicates that it was created by Pipeline