gcloud container aws clusters get-credentials (CLUSTER : --location=LOCATION) [--private-endpoint] [GCLOUD_WIDE_FLAG …]
(DEPRECATED) This command is deprecated. See https://cloud.google.com/kubernetes-engine/multi-cloud/docs/aws/deprecations/deprecation-announcement
for more details.
Fetch credentials for a running Anthos cluster on AWS.
This command updates a kubeconfig file with appropriate credentials and endpoint information to point kubectl at a specific Anthos cluster on AWS.
By default, credentials are written to
. You can provide an
alternate path by setting the HOME/.kube/config
environment variable. If KUBECONFIG
contains multiple paths, the first one is used.
KUBECONFIG
This command enables switching to a specific cluster, when working with multiple clusters. It can also be used to access a previously created cluster from a new workstation.
By default, the command will configure kubectl to automatically refresh its
credentials using the same identity as the gcloud command-line tool. If you are
running kubectl as part of an application, it is recommended to use application
default credentials. To configure a kubeconfig file to use application
default credentials, set the
Google Cloud CLI
property to container/use_application_default_credentials before running the
command.
true
my-cluster managed in location
us-west1, run:
gcloud container aws clusters get-credentials my-cluster --location=us-west1
To set the project attribute:
cluster on the command line with a fully
specified name;
--project on the command line;
core/project.
CLUSTER
To set the cluster attribute:
cluster on the command line.
--location=LOCATIONlocation attribute:
cluster on the command line with a fully
specified name;
--location on the command line;
container_aws/location.
--private-endpoint--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha container aws clusters get-credentials
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.