I remember there was an option in gitlab to rename branch but I don't see such option in AWS CodeCommit.
I also tried to find such command in aws command line itility ('aws codecommit help') but there was no any as well.
The only solution I could find: Let's say we need to rename A -> B. We create branch B from A and then remove A. Found on some old gitlab forums, probably gitlab did not had 'rename' feature long time ago.
EDIT: If you want to rename a default branch then default branch must be changed before removal (you may switch it to the newly created branch). Default branch configuration is under the Settings repository menu, which is on the same level as Code, Pull requests, Commits and so on.