Issues with MULTIPLE AWS CLI configuration

Issues with MULTIPLE AWS CLI configuration

If you are having issues with a double or multiple AWS CLI configuration, you can follow these steps to avoid the issues :

  1. Check if you have multiple AWS CLI configurations by running the command

     aws configure list
    

    This command will list all the available configurations on your system.

  2. If you have multiple configurations, you can either remove the unwanted configuration or set the default configuration to the one you want to use. To remove a configuration, run the command

     aws configure --profile profile_name delete
    

    Replace profile_name with the name of the profile that you want to delete.

  3. To set the default configuration to a specific profile, run this command

     export AWS_PROFILE=profile_name
    

    Replace profile_name with the name of the profile that you want to set as the default.

  4. If you want to use a specific configuration for a command, you can specify the profile using the --profile option. For example, if you want to use the profile named "test" to list all the S3 buckets, you can run the command

     aws s3 ls --profile test
    

By following these steps, you can avoid issues with a double AWS CLI configuration and ensure that you are using the correct configuration for your commands.