forked from gruntwork-io/cloud-nuke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheks_types.go
34 lines (28 loc) · 886 Bytes
/
eks_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package aws
import (
awsgo "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/gruntwork-io/gruntwork-cli/errors"
)
// EKSClusters - Represents all EKS clusters found in a region
type EKSClusters struct {
Clusters []string
}
// ResourceName - The simple name of the aws resource
func (clusters EKSClusters) ResourceName() string {
return "ekscluster"
}
// ResourceIdentifiers - The Name of the collected EKS clusters
func (clusters EKSClusters) ResourceIdentifiers() []string {
return clusters.Clusters
}
func (clusters EKSClusters) MaxBatchSize() int {
return 200
}
// Nuke - nuke all EKS Cluster resources
func (clusters EKSClusters) Nuke(awsSession *session.Session, identifiers []string) error {
if err := nukeAllEksClusters(awsSession, awsgo.StringSlice(identifiers)); err != nil {
return errors.WithStackTrace(err)
}
return nil
}