ec2

package
v0.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstances

GetInstances retrieves information about your Amazon Elastic Compute Cloud (Amazon EC2) instances. Inputs:

c is the context of the method call, which includes the AWS Region.
api is the interface that defines the method call.
input defines the input arguments to the service call.

Output:

If success, a DescribeInstancesOutput object containing the result of the service call and nil.
Otherwise, nil and an error from the call to DescribeInstances.

Types

type EC2DescribeInstancesAPI

type EC2DescribeInstancesAPI interface {
	DescribeInstances(ctx context.Context,
		params *ec2.DescribeInstancesInput,
		optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
}

EC2DescribeInstancesAPI defines the interface for the DescribeInstances function. We use this interface to test the function using a mocked service.

type MyInstanceInfo

type MyInstanceInfo struct {
	Name       string
	Id         string
	Type       string
	State      string
	Ami        string
	LaunchTime time.Time
	PrivateIp  string
	PublicIp   string
}

func DescribeInstances

func DescribeInstances(region *string, profile *string) []MyInstanceInfo

Jump to

Keyboard shortcuts

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