Aws-cli: update-kubeconfig Unknown parameter in input: "name", must be one of: clusterName

Created on 3 Apr 2019  路  14Comments  路  Source: aws/aws-cli

aws --version
aws-cli/1.16.127 Python/2.7.10 Darwin/18.2.0 botocore/1.12.117

Kubernetes Version - 1.11
EKS Platform Version - eks.2

Hi team! I am running into an issue with my EKS cluster, whereby I am unable to successfully execute the steps outlined in "Create a kubeconfig for Amazon EKS" - https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html (docs feedback sent as well), specifically, using the update-kubeconfig command to generate the my kubeconfig.

If I create the kubeconfig file manually, as outlined, it works fine, but when I try the command as documented:

aws eks --region region update-kubeconfig --name cluster_name

I receive:

aws eks --region us-east-1 update-kubeconfig  --name eks

Parameter validation failed:
Missing required parameter in input: "clusterName"
Unknown parameter in input: "name", must be one of: clusterName

I am wondering if the fact that I named my cluster eks is freaking the command out??

Am I just not executing the command correctly?

Let me know if there i any other info I can provide or other steps I can try.

Thanks!

eks-kubeconfig guidance

Most helpful comment

Hi Sweta/Eric

I ran the following commands and it is working now. I think I didn't need to re-install awscli but removing the ~/.aws/models/eks dir with the offending service-2.json fixed the issue.

$ rm -fr ~/.aws/models/eks
$ brew remove awscli
$ brew install awscli
$ ls ~/.aws/models/eks
ls: /Users/grant/.aws/models/eks: No such file or directory
$ aws eks --region us-west-2 update-kubeconfig --name grant-eks-win                                                                                                                                                                           
Added new context arn:aws:eks:us-west-2:260756362918:cluster/grant-eks-win to /Users/grant/.kube/config

All 14 comments

@matthewmodestino - Thank you for reporting the behavior. I am not able to reproduce the issue. Can you please run the following command and provide the output.

aws eks --region us-east-1 update-kubeconfig  --name eks --debug
aws eks --region us-east-1 update-kubeconfig  --name eks --debug
2019-04-03 20:51:12,334 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.16.127 Python/2.7.10 Darwin/18.2.0 botocore/1.12.117
2019-04-03 20:51:12,334 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['eks', '--region', 'us-east-1', 'update-kubeconfig', '--name', 'eks', '--debug']
2019-04-03 20:51:12,334 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x1023eab18>
2019-04-03 20:51:12,334 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x101c80aa0>
2019-04-03 20:51:12,334 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x101ce5488>
2019-04-03 20:51:12,338 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x101fba8c0>
2019-04-03 20:51:12,339 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /Users/mmodestino/.aws/models/eks/2017-11-01/service-2.json
2019-04-03 20:51:12,340 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws/lib/python2.7/site-packages/botocore/data/eks/2017-11-01/service-2.sdk-extras.json
2019-04-03 20:51:12,341 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.eks: calling handler <function register_retries_for_service at 0x101893758>
2019-04-03 20:51:12,341 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: eks
2019-04-03 20:51:12,342 - MainThread - botocore.hooks - DEBUG - Event building-command-table.eks: calling handler <function inject_commands at 0x102336de8>
2019-04-03 20:51:12,342 - MainThread - botocore.hooks - DEBUG - Event building-command-table.eks: calling handler <function add_waiters at 0x1023f3b18>
2019-04-03 20:51:12,355 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws/lib/python2.7/site-packages/botocore/data/eks/2017-11-01/waiters-2.json
2019-04-03 20:51:12,356 - MainThread - botocore.hooks - DEBUG - Event building-command-table.update-kubeconfig: calling handler <function add_waiters at 0x1023f3b18>
2019-04-03 20:51:12,356 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.role-arn: calling handler <awscli.paramfile.URIArgumentHandler object at 0x102532090>
2019-04-03 20:51:12,357 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.verbose: calling handler <awscli.paramfile.URIArgumentHandler object at 0x102532090>
2019-04-03 20:51:12,357 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.update-kubeconfig: calling handler <awscli.argprocess.ParamShorthandParser object at 0x102401ad0>
2019-04-03 20:51:12,357 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.dry-run: calling handler <awscli.paramfile.URIArgumentHandler object at 0x102532090>
2019-04-03 20:51:12,357 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.update-kubeconfig: calling handler <awscli.argprocess.ParamShorthandParser object at 0x102401ad0>
2019-04-03 20:51:12,357 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.kubeconfig: calling handler <awscli.paramfile.URIArgumentHandler object at 0x102532090>
2019-04-03 20:51:12,358 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.alias: calling handler <awscli.paramfile.URIArgumentHandler object at 0x102532090>
2019-04-03 20:51:12,358 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x102532090>
2019-04-03 20:51:12,358 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.update-kubeconfig: calling handler <awscli.argprocess.ParamShorthandParser object at 0x102401ad0>
2019-04-03 20:51:12,358 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2019-04-03 20:51:12,358 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2019-04-03 20:51:12,358 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2019-04-03 20:51:12,358 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2019-04-03 20:51:12,359 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws/lib/python2.7/site-packages/botocore/data/endpoints.json
2019-04-03 20:51:12,385 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x10188ced8>
2019-04-03 20:51:12,386 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.eks: calling handler <function add_generate_presigned_url at 0x101833488>
2019-04-03 20:51:12,386 - MainThread - botocore.regions - DEBUG - Creating a regex based endpoint for eks, us-east-1
2019-04-03 20:51:12,387 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2019-04-03 20:51:12,438 - MainThread - botocore.endpoint - DEBUG - Setting eks timeout as (60, 60)
2019-04-03 20:51:12,439 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: eks
2019-04-03 20:51:12,440 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.eks.DescribeCluster: calling handler <function generate_idempotent_uuid at 0x1018931b8>
2019-04-03 20:51:12,440 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/usr/local/aws/lib/python2.7/site-packages/awscli/clidriver.py", line 207, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/usr/local/aws/lib/python2.7/site-packages/awscli/clidriver.py", line 348, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/usr/local/aws/lib/python2.7/site-packages/awscli/customizations/commands.py", line 187, in __call__
    return self._run_main(parsed_args, parsed_globals)
  File "/usr/local/aws/lib/python2.7/site-packages/awscli/customizations/eks/update_kubeconfig.py", line 147, in _run_main
    new_cluster_dict = client.get_cluster_entry()
  File "/usr/local/aws/lib/python2.7/site-packages/awscli/customizations/eks/update_kubeconfig.py", line 300, in get_cluster_entry
    cert_data = self._get_cluster_description().get("certificateAuthority",
  File "/usr/local/aws/lib/python2.7/site-packages/awscli/customizations/eks/update_kubeconfig.py", line 284, in _get_cluster_description
    full_description = client.describe_cluster(name=self._cluster_name)
  File "/usr/local/aws/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/aws/lib/python2.7/site-packages/botocore/client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/usr/local/aws/lib/python2.7/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "/usr/local/aws/lib/python2.7/site-packages/botocore/validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
ParamValidationError: Parameter validation failed:
Missing required parameter in input: "clusterName"
Unknown parameter in input: "name", must be one of: clusterName
2019-04-03 20:51:12,446 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

Parameter validation failed:
Missing required parameter in input: "clusterName"
Unknown parameter in input: "name", must be one of: clusterName

thanks for looking!

Hi I am seeing the same error:

aws --version                                                                                                            
aws-cli/1.16.130 Python/3.7.3 Darwin/17.7.0 botocore/1.12.120
aws eks --region us-west-2 update-kubeconfig --name grant-eks-win  --debug                                                 
2019-04-04 16:58:52,894 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.16.130 Python/3.7.3 Darwin/17.7.0 botocore/1.12.120
2019-04-04 16:58:52,895 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['eks', '--region', 'us-west-2', 'update-kubeconfig', '--name', 'grant-eks-win', '--debug']
2019-04-04 16:58:52,895 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x10622c8c8>
2019-04-04 16:58:52,895 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x105c90598>
2019-04-04 16:58:52,895 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x105cc8510>
2019-04-04 16:58:52,905 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x1060f2a60>
2019-04-04 16:58:52,906 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /Users/grant/.aws/models/eks/2017-11-01/service-2.json
2019-04-04 16:58:52,907 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/data/eks/2017-11-01/service-2.sdk-extras.json
2019-04-04 16:58:52,908 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.eks: calling handler <function register_retries_for_service at 0x1057c5620>
2019-04-04 16:58:52,908 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: eks
2019-04-04 16:58:52,909 - MainThread - botocore.hooks - DEBUG - Event building-command-table.eks: calling handler <function inject_commands at 0x106174b70>
2019-04-04 16:58:52,909 - MainThread - botocore.hooks - DEBUG - Event building-command-table.eks: calling handler <function add_waiters at 0x106232d90>
2019-04-04 16:58:52,917 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/data/eks/2017-11-01/waiters-2.json
2019-04-04 16:58:52,918 - MainThread - botocore.hooks - DEBUG - Event building-command-table.update-kubeconfig: calling handler <function add_waiters at 0x106232d90>
2019-04-04 16:58:52,919 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x10630b4e0>
2019-04-04 16:58:52,919 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.update-kubeconfig: calling handler <awscli.argprocess.ParamShorthandParser object at 0x105c8dc50>
2019-04-04 16:58:52,919 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.kubeconfig: calling handler <awscli.paramfile.URIArgumentHandler object at 0x10630b4e0>
2019-04-04 16:58:52,920 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.role-arn: calling handler <awscli.paramfile.URIArgumentHandler object at 0x10630b4e0>
2019-04-04 16:58:52,920 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.dry-run: calling handler <awscli.paramfile.URIArgumentHandler object at 0x10630b4e0>
2019-04-04 16:58:52,920 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.update-kubeconfig: calling handler <awscli.argprocess.ParamShorthandParser object at 0x105c8dc50>
2019-04-04 16:58:52,920 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.verbose: calling handler <awscli.paramfile.URIArgumentHandler object at 0x10630b4e0>
2019-04-04 16:58:52,920 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.update-kubeconfig: calling handler <awscli.argprocess.ParamShorthandParser object at 0x105c8dc50>
2019-04-04 16:58:52,920 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.update-kubeconfig.alias: calling handler <awscli.paramfile.URIArgumentHandler object at 0x10630b4e0>
2019-04-04 16:58:52,929 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2019-04-04 16:58:52,930 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2019-04-04 16:58:52,930 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2019-04-04 16:58:52,930 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2019-04-04 16:58:52,931 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/data/endpoints.json
2019-04-04 16:58:52,934 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x10579f8c8>
2019-04-04 16:58:52,934 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.eks: calling handler <function add_generate_presigned_url at 0x105762400>
2019-04-04 16:58:52,935 - MainThread - botocore.regions - DEBUG - Creating a regex based endpoint for eks, us-west-2
2019-04-04 16:58:52,935 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2019-04-04 16:58:52,957 - MainThread - botocore.endpoint - DEBUG - Setting eks timeout as (60, 60)
2019-04-04 16:58:52,958 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: eks
2019-04-04 16:58:52,959 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.eks.DescribeCluster: calling handler <function generate_idempotent_uuid at 0x1057a8f28>
2019-04-04 16:58:52,959 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 207, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/awscli/clidriver.py", line 348, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/awscli/customizations/commands.py", line 187, in __call__
    return self._run_main(parsed_args, parsed_globals)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/awscli/customizations/eks/update_kubeconfig.py", line 147, in _run_main
    new_cluster_dict = client.get_cluster_entry()
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/awscli/customizations/eks/update_kubeconfig.py", line 300, in get_cluster_entry
    cert_data = self._get_cluster_description().get("certificateAuthority",
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/awscli/customizations/eks/update_kubeconfig.py", line 284, in _get_cluster_description
    full_description = client.describe_cluster(name=self._cluster_name)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/client.py", line 634, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
    api_params, operation_model)
  File "/usr/local/Cellar/awscli/1.16.130/libexec/lib/python3.7/site-packages/botocore/validate.py", line 297, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "clusterName"
Unknown parameter in input: "name", must be one of: clusterName
2019-04-04 16:58:52,970 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

Parameter validation failed:
Missing required parameter in input: "clusterName"
Unknown parameter in input: "name", must be one of: clusterName

I am facing the same issue

aws --version
aws-cli/1.16.112 Python/3.6.4 Darwin/16.7.0 botocore/1.12.102
aws eks --region us-east-1 update-kubeconfig --name PrimaryEKSCluster

Parameter validation failed:
Missing required parameter in input: "clusterName"
Unknown parameter in input: "name", must be one of: clusterName

When I try with clusterName, I get the following error:

aws eks update-kubeconfig --region=us-east-1 --clusterName=PrimaryEKSCluster
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: the following arguments are required: --name

The command and the parameter seems to be in correct format . This error generally occurs when the provided parameter is not one of the required parameter. The required parameters are fetched from a configuration file service2.json.

From the debug log i can see that there is an internal call to describe-cluster with the parameter name. However, the log says the required parameter is clusterName . One possible case can be incorrect required parameters inside config file.

To verify, please provide these info.

  1. Output of this command

aws eks describe-cluster --name grant-eks-win

  1. DescribeClusterRequest section from the file.

botocore/data/eks/2017-11-01/service-2.json

This file should be present in your botocore installation directory.

My section looks like this and I don't get any error.

"DescribeClusterRequest":{
      "type":"structure",
      "required":["name"],
      "members":{
        "name":{
          "shape":"String",
          "documentation":"<p>The name of the cluster to describe.</p>",
          "location":"uri",
          "locationName":"name"
        }
      }
    },

Hi Sweta,

In my profile I found the service-2.json and it does not match what you see.
How do I cleanup/reinstall to get the correct service-2.json file? I installed this
with homebrew.

/Users/grant/.aws/models/eks/2017-11-01/service-2.json

"DescribeCluster":{
"name":"DescribeCluster",
"http":{
"method":"GET",
"requestUri":"/clusters/{clusterName}"
},
"input":{"shape":"DescribeClusterRequest"},
"output":{"shape":"DescribeClusterResponse"},
"errors":[
{"shape":"ResourceNotFoundException"},
{"shape":"ClientException"},
{"shape":"ServerException"}
],
"documentation":"

Returns descriptive information about an Amazon
EKS cluster.

"
},

@granttigera - Thanks for replying.
I actually needed the DescribeClusterRequest section not the DescribeCluster one.

Also, please attach the eks/2017-11-01/service-2.json file

HI Sweta,

You can find the service file here:
service-2.json.zip

@granttigera - Thank you for providing the file. The service-2.json file you provided is different from the file that is in GitHub. The required parameter in both the files are different that's why you are getting that error.
I would recommend you to uninstall AWS CLI and install using virtual environment. Here is the link to install AWS CLI using virtual env. https://docs.aws.amazon.com/cli/latest/userguide/install-virtualenv.html

Screen Shot 2019-04-16 at 6 52 58 PM
Here is the screenshot showing the difference. Left one is the file you provided.

It looks like you have a preview version of the Amazon EKS service model for the AWS CLI (from before the public service launch).

The syntax for many Amazon EKS commands has changed since the public service launch. Update your AWS CLI version to the latest available and delete the custom service model directory at ~/.aws/models/eks.

As long as your custom preview version of service-2.json exists at that location, it will override the up-to-date service model that the AWS CLI should use by default.

Hi Sweta/Eric

I ran the following commands and it is working now. I think I didn't need to re-install awscli but removing the ~/.aws/models/eks dir with the offending service-2.json fixed the issue.

$ rm -fr ~/.aws/models/eks
$ brew remove awscli
$ brew install awscli
$ ls ~/.aws/models/eks
ls: /Users/grant/.aws/models/eks: No such file or directory
$ aws eks --region us-west-2 update-kubeconfig --name grant-eks-win                                                                                                                                                                           
Added new context arn:aws:eks:us-west-2:260756362918:cluster/grant-eks-win to /Users/grant/.kube/config

thanks team! testing now! will report back shortly.

deleting service-2.json fixed the issue for me as well, thank you!

I am closing the issue as this is resolved.

Was this page helpful?
0 / 5 - 0 ratings