ardito.bryan
ardito.bryan

Reputation: 491

how do I delete an aws configure profile?

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.

Upvotes: 3

Views: 12563

Answers (1)

Leonardo Santos
Leonardo Santos

Reputation: 96

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.

Upvotes: 8

Related Questions