3

To create a custom configure profile in aws cli I am using the following command:

aws configure --profile user1

However, I cannot find any command to delete one of my profiles.

1 Answer 1

8

Hi you need a command or do you just need remove the profile?

You can edit the: Windows

C:\Users\USERNAME\.AWS\credentials
C:\Users\USERNAME\.AWS\config
    
(%USERPROFILE%\.aws\config 
%USERPROFILE%\.aws\credentials)

or

Linux and macOS

~/.aws/config ~/.aws/credentials
~/.aws/config ~/.aws/config

If you were worried about do it many times, you can create a script with powershell or sed…

Get-Content test.txt) | ForEach-Object { $_ -replace "<profile>", "" } | Set-Content C:\Users\USERNAME.AWS\config

Or

sed -i 's/"[profile profile]//g' ~/.aws/config

Important: you need write the replace to all lines regarding your unless profile and I should do it too for your credentials file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.