aws

package
v0.0.0-...-be4dc66 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	EC2 *ec2.EC2
	ELB *elb.ELB
	STS *sts.STS
}

Client is a struct containing several clients for the different AWS services it needs to interact with. * EC2 is the standard client for the EC2 service. * ELB is the standard client for the ELB service. * STS is the standard client for the STS service.

func (*Client) DeleteELB

func (c *Client) DeleteELB(name string) error

DeleteELB deletes the load balancer with the specific <name>. If it does not exist, no error is returned.

func (*Client) DeleteSecurityGroup

func (c *Client) DeleteSecurityGroup(id string) error

DeleteSecurityGroup deletes the security group with the specific <id>. If it does not exist, no error is returned.

func (*Client) GetAccountID

func (c *Client) GetAccountID() (string, error)

GetAccountID returns the ID of the AWS account the Client is interacting with.

func (*Client) GetInternetGateway

func (c *Client) GetInternetGateway(vpcID string) (string, error)

GetInternetGateway returns the ID of the internet gateway attached to the given VPC <vpcID>. If there is no internet gateway attached, the returned string will be empty.

func (*Client) ListKubernetesELBs

func (c *Client) ListKubernetesELBs(vpcID, clusterName string) ([]string, error)

ListKubernetesELBs returns the list of load balancers in the given <vpcID> tagged with <clusterName>.

func (*Client) ListKubernetesSecurityGroups

func (c *Client) ListKubernetesSecurityGroups(vpcID, clusterName string) ([]string, error)

ListKubernetesSecurityGroups returns the list of security groups in the given <vpcID> tagged with <clusterName>.

type ClientInterface

type ClientInterface interface {
	GetAccountID() (string, error)
	GetInternetGateway(string) (string, error)

	// The following functions are only temporary needed due to https://github.com/gardener/gardener/issues/129.
	ListKubernetesELBs(vpcID, clusterName string) ([]string, error)
	ListKubernetesSecurityGroups(vpcID, clusterName string) ([]string, error)
	DeleteELB(name string) error
	DeleteSecurityGroup(id string) error
}

ClientInterface is an interface which must be implemented by AWS clients.

func NewClient

func NewClient(accessKeyID, secretAccessKey, region string) ClientInterface

NewClient creates a new Client for the given AWS credentials <accessKeyID>, <secretAccessKey>, and the AWS region <region>. It initializes the clients for the various services like EC2, ELB, etc.

Jump to

Keyboard shortcuts

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