I have been configuring my aws credentials using aws configure. I use 2 AWS accounts on my PC. I have been using one account for a long time now. Now when I switched back to the old one its serverless.yml had a "profile : iot " field so in my credentials file I set the profile to [iot] but when I use serverless deploy, it shows that lambdas with these names already exist. How can I handle this?
Can you provide a little more information about what you have tried as far as troubleshooting?
Do you have both profiles in your credential file?
I used aws configure to add my credentials for the aws accounts as I am using Windows. I never mentioned profile while configuring credentials. In one of the account’s (say X) serverless I had a “profile” field in my serverless.yml having a value “iot”. I was for sometime using the other account (say Y) whose serverless.yml had no profile option so I guess it used default as profile for account Y. Now when I changed credentials back to account X I was getting an error no “iot” profile exists so I went to credential file it had stored the credentials for this account X in default profile like this [default] so I changed it to [iot] my profile being “iot”. Now when I use serverless deploy it gives error that logs for these lambda are already there.
Have you checked both accounts on the AWS Console to see if the Lambdas are there?
Yes both the account’s lambdas are there and working fine. Its just I am unable to deploy or change anything in account X.