How to set the default client credential for a cloud

See also:

The set-default-credential command allows you to select the default credential for a particular cloud. For example, the following command sets the credential named carol as the default credential for the aws cloud:

juju set-default-credential aws carol

Some Juju commands (bootstrap, add-model etc.) require a suitable local cloud credential to be specified. If only a single credential is defined for a particular cloud, it becomes the effective default credential for that cloud and will be automatically used by the aforementioned commands.

However, when multiple credentials are defined, you will need to either set a default one (following the steps above) or manually specify the name of the credential to be used for each Juju command via the --credential flag. Failure to do so will cause the Juju client to emit an error:

ERROR more than one credential is available
specify a credential using the --credential argument

To see the default credentials currently in use run the juju credentials command with default credentials annotated by an asterisk. See How to list credentials for more information.

Last updated a month ago.