duo-labs / cloudmapper

CloudMapper helps you analyze your Amazon Web Services (AWS) environments.
BSD 3-Clause "New" or "Revised" License
5.99k stars 809 forks source link

EKS: Unknown parameter in input: "cluster", must be one of: name #759

Closed christophetd closed 4 years ago

christophetd commented 4 years ago

Possibly related: #729

Running python cloudmapper.py collect --account some-account fails when collecting data about EKS clusters:

Failures:                                                                                                                                                                                     
  eks.describe_cluster({'cluster': 'cluster1'}): Parameter validation failed:                                                                                                   
Missing required parameter in input: "name"                                                                                                                                                   
Unknown parameter in input: "cluster", must be one of: name                                                                                                                                   
  eks.describe_cluster({'cluster': 'cluster2'}): Parameter validation failed:                                                                                                      
Missing required parameter in input: "name"                                                                                                                                                   
Unknown parameter in input: "cluster", must be one of: name                                                                                                                                   
  eks.describe_cluster({'cluster': 'cluster3'}): Parameter validation failed:                                                                                                               
Missing required parameter in input: "name"                                                                                                                                                   
Unknown parameter in input: "cluster", must be one of: name
  eks.describe_cluster({'cluster': 'cluster4'}): Parameter validation failed:
Missing required parameter in input: "name"
Unknown parameter in input: "cluster", must be one of: name

Note that there are 4 EKS clusters in my account, which I renamed to cluster1, cluster2, cluster3, cluster4. Boto3 docs show that the correct parameter seems indeed to be name: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/eks.html#EKS.Client.describe_cluster

Using Python 3.6.9 on latest Cloudmapper main branch

christophetd commented 4 years ago

It seems that applying the following patch fixes the issue:

diff --git a/collect_commands.yaml b/collect_commands.yaml
index b82bdd3..0e26a84 100644
--- a/collect_commands.yaml
+++ b/collect_commands.yaml
@@ -352,7 +352,7 @@
 - Service: eks
   Request: describe-cluster
   Parameters:
-  - Name: cluster
+  - Name: name
     Value: eks-list-clusters.json|.clusters[]
 - Service: logs
   Request: describe-destinations
* Getting eks:describe-cluster info
  Making call for account-data/./dev/eu-west-2/eks-describe-cluster/cluster1
  Making call for account-data/./dev/eu-west-1/eks-describe-cluster/cluster2
  Making call for account-data/./dev/eu-west-1/eks-describe-cluster/cluster3
  Making call for account-data/./dev/eu-central-1/eks-describe-cluster/cluster4
  Skipping region us-west-1, as eks does not exist there

I'm unsure if someone else can reproduce and if it might have been caused by recent EKS API changes?

daroga0002 commented 4 years ago

it was solved https://github.com/duo-labs/cloudmapper/pull/768