Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I delete an aws configure profile?

Tags:

aws-cli

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.

like image 472
ardito.bryan Avatar asked Sep 03 '25 03:09

ardito.bryan


1 Answers

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.

like image 59
Leonardo Santos Avatar answered Sep 04 '25 23:09

Leonardo Santos