Documentation ¶
Overview ¶
Package aws contains functions related to aws sdk
Index ¶
- type Client
- type CloudTrailAPI
- type EC2API
- type SdkClient
- func (c *SdkClient) AssumeRole(roleARN, region string) (*SdkClient, error)
- func (c *SdkClient) GetAWSCredentials() awsv2.Credentials
- func (c *SdkClient) GetRouteTableForSubnet(subnetID string) (ec2v2types.RouteTable, error)
- func (c *SdkClient) GetSecurityGroupID(infraID string) (string, error)
- func (c *SdkClient) GetSubnetID(infraID string) ([]string, error)
- func (c *SdkClient) IsSubnetPrivate(subnet string) (bool, error)
- func (c *SdkClient) ListAllInstanceStopEventsV2() ([]cloudtrailv2types.Event, error)
- func (c *SdkClient) ListAllTerminatedInstancesV2() ([]cloudtrailv2types.Event, error)
- func (c *SdkClient) ListNonRunningInstances(infraID string) ([]ec2v2types.Instance, error)
- func (c *SdkClient) ListRunningInstances(infraID string) ([]ec2v2types.Instance, error)
- func (c *SdkClient) PollInstanceStopEventsFor(instances []ec2v2types.Instance, retryTimes int) ([]cloudtrailv2types.Event, error)
- type StsAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ListRunningInstances(infraID string) ([]ec2v2types.Instance, error) ListNonRunningInstances(infraID string) ([]ec2v2types.Instance, error) PollInstanceStopEventsFor(instances []ec2v2types.Instance, retryTimes int) ([]cloudtrailv2types.Event, error) GetAWSCredentials() awsv2.Credentials GetSecurityGroupID(infraID string) (string, error) GetSubnetID(infraID string) ([]string, error) IsSubnetPrivate(subnet string) (bool, error) GetRouteTableForSubnet(subnetID string) (ec2v2types.RouteTable, error) }
type CloudTrailAPI ¶
type CloudTrailAPI interface {
LookupEvents(ctx context.Context, in *cloudtrailv2.LookupEventsInput, optFns ...func(*cloudtrailv2.Options)) (*cloudtrailv2.LookupEventsOutput, error)
}
type EC2API ¶
type EC2API interface { DescribeInstances(ctx context.Context, in *ec2v2.DescribeInstancesInput, optFns ...func(*ec2v2.Options)) (*ec2v2.DescribeInstancesOutput, error) DescribeSecurityGroups(ctx context.Context, in *ec2v2.DescribeSecurityGroupsInput, optFns ...func(*ec2v2.Options)) (*ec2v2.DescribeSecurityGroupsOutput, error) DescribeSubnets(ctx context.Context, in *ec2v2.DescribeSubnetsInput, optFns ...func(*ec2v2.Options)) (*ec2v2.DescribeSubnetsOutput, error) DescribeRouteTables(ctx context.Context, in *ec2v2.DescribeRouteTablesInput, optFns ...func(*ec2v2.Options)) (*ec2v2.DescribeRouteTablesOutput, error) }
type SdkClient ¶
type SdkClient struct { Credentials awsv2.Credentials Region string CloudtrailClient CloudTrailAPI Ec2Client EC2API StsClient StsAPI }
func NewClientFromFileCredentials ¶
NewClientFromFileCredentials creates a new client by reading credentials from a file
func (*SdkClient) AssumeRole ¶
AssumeRole returns you a new client in the account specified in the roleARN
func (*SdkClient) GetAWSCredentials ¶
func (c *SdkClient) GetAWSCredentials() awsv2.Credentials
GetAWSCredentials gets the AWS credentials
func (*SdkClient) GetRouteTableForSubnet ¶
func (c *SdkClient) GetRouteTableForSubnet(subnetID string) (ec2v2types.RouteTable, error)
GetRouteTableForSubnet returns the subnets routeTable
func (*SdkClient) GetSecurityGroupID ¶
GetSecurityGroupID will return the security group id needed for the network verifier
func (*SdkClient) GetSubnetID ¶
GetSubnetID will return the private subnets needed for the network verifier
func (*SdkClient) IsSubnetPrivate ¶
IsSubnetPrivate checks if the provided subnet is private
func (*SdkClient) ListAllInstanceStopEventsV2 ¶
func (c *SdkClient) ListAllInstanceStopEventsV2() ([]cloudtrailv2types.Event, error)
ListAllInstanceStopEvents lists StopInstances events from CloudTrail
func (*SdkClient) ListAllTerminatedInstancesV2 ¶
func (c *SdkClient) ListAllTerminatedInstancesV2() ([]cloudtrailv2types.Event, error)
ListAllTerminatedInstances lists TerminatedInstances events from CloudTrail
func (*SdkClient) ListNonRunningInstances ¶
func (c *SdkClient) ListNonRunningInstances(infraID string) ([]ec2v2types.Instance, error)
ListNonRunningInstances lists all non-running instances that belong to a cluster
func (*SdkClient) ListRunningInstances ¶
func (c *SdkClient) ListRunningInstances(infraID string) ([]ec2v2types.Instance, error)
ListRunningInstances lists all running or starting instances that belong to a cluster
func (*SdkClient) PollInstanceStopEventsFor ¶
func (c *SdkClient) PollInstanceStopEventsFor(instances []ec2v2types.Instance, retryTimes int) ([]cloudtrailv2types.Event, error)