Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateBucketIfNotExists(ctx context.Context, bucket, region string) error
- func (c *Client) DeleteBucketIfExists(ctx context.Context, bucket string) error
- func (c *Client) DeleteELB(ctx context.Context, name string) error
- func (c *Client) DeleteELBV2(ctx context.Context, arn *string) error
- func (c *Client) DeleteObjectsWithPrefix(ctx context.Context, bucket, prefix string) error
- func (c *Client) DeleteSecurityGroup(ctx context.Context, id string) error
- func (c *Client) GetAccountID(ctx context.Context) (string, error)
- func (c *Client) GetInternetGateway(ctx context.Context, vpcID string) (string, error)
- func (c *Client) ListKubernetesELBs(ctx context.Context, vpcID, clusterName string) ([]string, error)
- func (c *Client) ListKubernetesELBsV2(ctx context.Context, vpcID, clusterName string) ([]LoadBalancer, error)
- func (c *Client) ListKubernetesSecurityGroups(ctx context.Context, vpcID, clusterName string) ([]string, error)
- func (c *Client) VerifyVPCAttributes(ctx context.Context, vpcID string) error
- type Interface
- type LoadBalancer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { EC2 ec2iface.EC2API STS stsiface.STSAPI IAM iamiface.IAMAPI S3 s3iface.S3API ELB elbiface.ELBAPI ELBv2 elbv2iface.ELBV2API }
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. * STS is the standard client for the STS service. * IAM is the standard client for the IAM service. * S3 is the standard client for the S3 service. * ELB is the standard client for the ELB service. * ELBv2 is the standard client for the ELBv2 service.
func NewClient ¶
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.
func (*Client) CreateBucketIfNotExists ¶
CreateBucketIfNotExists creates the s3 bucket with name <bucket> in <region>. If it already exist, no error is returned.
func (*Client) DeleteBucketIfExists ¶
DeleteBucketIfExists deletes the s3 bucket with name <bucket>. If it does not exist, no error is returned.
func (*Client) DeleteELB ¶
DeleteELB deletes the loadbalancer with the specific <name>. If it does not exist, no error is returned.
func (*Client) DeleteELBV2 ¶
DeleteELBV2 deletes the loadbalancer (NLB or ALB) as well as its target groups with its Amazon Resource Name (ARN) . If it does not exist, no error is returned.
func (*Client) DeleteObjectsWithPrefix ¶
DeleteObjectsWithPrefix deletes the s3 objects with the specific <prefix> from <bucket>. If it does not exist, no error is returned.
func (*Client) DeleteSecurityGroup ¶
DeleteSecurityGroup deletes the security group with the specific <id>. If it does not exist, no error is returned.
func (*Client) GetAccountID ¶
GetAccountID returns the ID of the AWS account the Client is interacting with.
func (*Client) GetInternetGateway ¶
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(ctx context.Context, vpcID, clusterName string) ([]string, error)
ListKubernetesELBs returns the list of ELB loadbalancers in the given <vpcID> tagged with <clusterName>.
func (*Client) ListKubernetesELBsV2 ¶
func (c *Client) ListKubernetesELBsV2(ctx context.Context, vpcID, clusterName string) ([]LoadBalancer, error)
ListKubernetesELBsV2 returns a slice of loadbalancer tuples (of types either NLB or ALB) in the given <vpcID> tagged with <clusterName>.
type Interface ¶
type Interface interface { GetAccountID(ctx context.Context) (string, error) GetInternetGateway(ctx context.Context, vpcID string) (string, error) VerifyVPCAttributes(ctx context.Context, vpcID string) error // S3 wrappers DeleteObjectsWithPrefix(ctx context.Context, bucket, prefix string) error CreateBucketIfNotExists(ctx context.Context, bucket, region string) error DeleteBucketIfExists(ctx context.Context, bucket string) error // The following functions are only temporary needed due to https://github.com/gardener/gardener/issues/129. ListKubernetesELBs(ctx context.Context, vpcID, clusterName string) ([]string, error) ListKubernetesELBsV2(ctx context.Context, vpcID, clusterName string) ([]LoadBalancer, error) ListKubernetesSecurityGroups(ctx context.Context, vpcID, clusterName string) ([]string, error) DeleteELB(ctx context.Context, name string) error DeleteELBV2(ctx context.Context, arn *string) error DeleteSecurityGroup(ctx context.Context, id string) error }
Interface is an interface which must be implemented by AWS clients.
type LoadBalancer ¶
LoadBalancer is a struct wrapper that holds loadbalancer metadata such as name, type, and arn.