aws

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// By default STS signs the url for 15 minutes so we are creating a
	// rfc3339 timestamp with expiration in 14 minutes as part of the token, which
	// is used by some clients (client-go) who will refresh the token after 14 mins
	TOKEN_EXPIRATION_MINS = 14
	URL_TIMEOUT_SECONDS   = 60
)
View Source
const (
	EKSServicePolicyARN = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy"
	EKSClusterPolicyARN = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy"
)
View Source
const (
	TagSubnetScope       = "k11n.dev/subnetScope"
	TagClusterName       = "k11n.dev/clusterName"
	TagClusterActivated  = "k11n.dev/clusterActivated"
	TagAutoscalerEnabled = "k8s.io/cluster-autoscaler/enabled"
	TagKonstellation     = "Konstellation"
	TagEKSNodeGroupName  = "eks:nodegroup-name"
	TagVPCTopology       = "k11n.dev/topology"
	TagKubeClusterPrefix = "kubernetes.io/cluster/"

	TagValue1       = "1"
	TagValuePrivate = "private"
	TagValuePublic  = "public"
	TagValueOwned   = "owned"
	TagValueShared  = "shared"
	TagValueTrue    = "true"
)
View Source
const (
	DefaultPageSize = 100
)

Variables

View Source
var EKSAllowedInstanceSeries = map[string]bool{
	"t3":   true,
	"t3a":  true,
	"m5":   true,
	"m5a":  true,
	"c5":   true,
	"r5":   true,
	"r5a":  true,
	"g4dn": true,
	"p2":   true,
	"p3":   true,
	"p3dn": true,
}
View Source
var EKSAllowedInstanceSizes = map[string]bool{
	"medium":   true,
	"large":    true,
	"xlarge":   true,
	"2xlarge":  true,
	"4xlarge":  true,
	"8xlarge":  true,
	"9xlarge":  true,
	"12xlarge": true,
}
View Source
var EKSAvailableVersions = []string{
	"1.19",
	"1.18",
	"1.17",
	"1.16",
}

Functions

func AutoscalerClusterNameTag

func AutoscalerClusterNameTag(cluster string) string

func CreateSession

func CreateSession() *session.Session

func GetEC2Tag

func GetEC2Tag(tags []*ec2.Tag, name string) *ec2.Tag

func KubeClusterTag

func KubeClusterTag(cluster string) string

func ListSecurityGroups

func ListSecurityGroups(ec2Svc *ec2.EC2, vpcId string) ([]*ec2.SecurityGroup, error)

func ListSubnets

func ListSubnets(ec2Svc *ec2.EC2, vpcId string) ([]*ec2.Subnet, error)

func VPCFilter

func VPCFilter(vpcId string) *ec2.Filter

Types

type ACMService

type ACMService struct {
	ACM *acm.ACM
	// contains filtered or unexported fields
}

func NewACMService

func NewACMService(s *session.Session) *ACMService

func (*ACMService) ImportCertificate

func (a *ACMService) ImportCertificate(ctx context.Context, cert []byte, pkey []byte, chain []byte, existingID string) (certificate *types.Certificate, err error)

func (*ACMService) ListCertificates

func (a *ACMService) ListCertificates(ctx context.Context) (certificates []*types.Certificate, err error)

type EC2InstancePricing

type EC2InstancePricing struct {
	InstanceType               string
	InstanceSeries             string
	InstanceSize               string
	CurrentGeneration          bool
	Memory                     string
	Storage                    string
	VCPUs                      int
	GPUs                       int
	OperatingSystem            string
	MaxIPs                     int
	EBSThroughput              string
	SupportsEnhancedNetworking bool
	NetworkPerformance         string
	OnDemandPriceUSD           float32
}

func ListEC2Instances

func ListEC2Instances(svc *pricing.Pricing, region string, currentOnly bool) (instances []*EC2InstancePricing, err error)

type EC2Service

type EC2Service struct {
	EC2 *ec2.EC2
	// contains filtered or unexported fields
}

func NewEC2Service

func NewEC2Service(s *session.Session) *EC2Service

func (*EC2Service) GetVPC

func (s *EC2Service) GetVPC(ctx context.Context, vpcId string) (vpc *types.VPC, err error)

func (*EC2Service) ListVPCs

func (s *EC2Service) ListVPCs(ctx context.Context) (vpcs []*types.VPC, err error)

type EKSService

type EKSService struct {
	EKS *eks.EKS
	// contains filtered or unexported fields
}

func NewEKSService

func NewEKSService(s *session.Session) *EKSService

func (*EKSService) CreateNodepool

func (s *EKSService) CreateNodepool(ctx context.Context, cc *v1alpha1.ClusterConfig, np *v1alpha1.Nodepool) error

func (*EKSService) DeleteNodeGroupNetworkingResources

func (s *EKSService) DeleteNodeGroupNetworkingResources(ctx context.Context, nodegroup string) error

func (*EKSService) DeleteNodepool

func (s *EKSService) DeleteNodepool(ctx context.Context, clusterName string, nodePool string) error

func (*EKSService) GetAuthToken

func (s *EKSService) GetAuthToken(ctx context.Context, cluster string, status types.ClusterStatus) (authToken *types.AuthToken, err error)

func (*EKSService) GetAvailableVersions

func (s *EKSService) GetAvailableVersions(ctx context.Context) ([]string, error)

func (*EKSService) GetCluster

func (s *EKSService) GetCluster(ctx context.Context, name string) (cluster *types.Cluster, err error)

func (*EKSService) IsNodepoolDeleted

func (s *EKSService) IsNodepoolDeleted(ctx context.Context, clusterName string, nodepoolName string) (deleted bool, err error)

func (*EKSService) IsNodepoolReady

func (s *EKSService) IsNodepoolReady(ctx context.Context, clusterName string, nodepoolName string) (ready bool, err error)

func (*EKSService) ListClusters

func (s *EKSService) ListClusters(ctx context.Context) (clusters []*types.Cluster, err error)

func (*EKSService) TagSubnetsForCluster

func (s *EKSService) TagSubnetsForCluster(ctx context.Context, clusterName string, subnetIds []string) error

func (*EKSService) UnTagSubnetsForCluster

func (s *EKSService) UnTagSubnetsForCluster(ctx context.Context, clusterName string, subnetIds []string) error

type IAMService

type IAMService struct {
	IAM *iam.IAM
}

func NewIAMService

func NewIAMService(s *session.Session) *IAMService

func (*IAMService) ListEKSServiceRoles

func (s *IAMService) ListEKSServiceRoles() (roles []*iam.Role, err error)

func (*IAMService) ListRoles

func (s *IAMService) ListRoles() (roles []*iam.Role, err error)

func (*IAMService) ListStandardRoles

func (s *IAMService) ListStandardRoles() ([]*iam.Role, error)

*

  • Lists roles that are not service linked

Jump to

Keyboard shortcuts

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