aws

package
v0.0.0-...-a0115ea Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallerIdentity

type CallerIdentity struct {
	sts.GetCallerIdentityOutput

	Username string
}

CallerIdentity holds the relevant output of the GetCallerIdentity function of the AWS SDK for STS

type Client

type Client interface {
	Config(ctx context.Context) (*aws.Config, error)
	GetClusterIPs(ctx context.Context, descInstanceAPI DescribeInstancesAPI, username string, filterExp FilterExposure) ([]ClusterIP, error)
	GetSortedClusterIPs(ctx context.Context, descInstanceAPI DescribeInstancesAPI, username string, filterExp FilterExposure) (SortedClusterIPs, error)
	GetEc2Client(ctx context.Context, config *aws.Config) (*ec2.Client, error)
	GetIdentity(ctx context.Context, callerIDAPI GetCallerIdentityAPI) (*CallerIdentity, error)
	GetStsClient(ctx context.Context, config *aws.Config) (*sts.Client, error)
}

Client holds the method signatures for an AWS client.

func NewClient

func NewClient(
	config ConfigFunc,
	getClusterIPs GetClusterIPsFunc,
	getSortedClusterIPsFunc GetSortedClusterIPsFunc,
	getEc2Client GetEc2ClientFunc,
	getIdentity GetIdentityFunc,
	getStsClient GetStsClientFunc,
) Client

NewClient returns a new AWS client with the provided configuration

type ClientGetter

type ClientGetter struct{}

ClientGetter is an interface for getting an BB AWS client.

func (*ClientGetter) GetClient

func (clientGetter *ClientGetter) GetClient() Client

GetClient returns a new AWS client.

type ClusterIP

type ClusterIP struct {
	IP            *string
	ReservationID *string
	InstanceID    *string
	IsPublic      bool
}

ClusterIP type

type ConfigFunc

type ConfigFunc func(context.Context) (*aws.Config, error)

ConfigFunc type

type DescribeInstancesAPI

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

DescribeInstancesAPI is an interface for the DescribeInstances function of the AWS SDK for EC2

type FilterExposure

type FilterExposure string

FilterExposure type

const (
	FilterExposurePublic  FilterExposure = "public"
	FilterExposurePrivate FilterExposure = "private"
	FilterExposureAll     FilterExposure = "all"
)

FilterExposure constants

type GetCallerIdentityAPI

type GetCallerIdentityAPI interface {
	GetCallerIdentity(
		ctx context.Context,
		params *sts.GetCallerIdentityInput,
		optFns ...func(*sts.Options),
	) (*sts.GetCallerIdentityOutput, error)
}

GetCallerIdentityAPI is an interface for the GetCallerIdentity function of the AWS SDK for STS

type GetClusterIPsFunc

GetClusterIPsFunc type

type GetEc2ClientFunc

type GetEc2ClientFunc func(context.Context, *aws.Config) (*ec2.Client, error)

GetEc2ClientFunc type

type GetIdentityFunc

type GetIdentityFunc func(context.Context, GetCallerIdentityAPI) (*CallerIdentity, error)

GetIdentityFunc type

type GetSortedClusterIPsFunc

GetSortedClusterIPsFunc type

type GetStsClientFunc

type GetStsClientFunc func(context.Context, *aws.Config) (*sts.Client, error)

GetStsClientFunc type

type SortedClusterIPs

type SortedClusterIPs struct {
	PublicIPs  []ClusterIP
	PrivateIPs []ClusterIP
}

SortedClusterIPs type

Jump to

Keyboard shortcuts

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