We received the new version of the serverless pro UI yesterday, and things are breaking left right and centre! I am not sure why we ever got rid of deployment profiles, it was a much better model! But anway:
Now I cant deploy using AWS_PROFILE from the cli.
Yesterday morning this command worked fine:
AWS_PROFILE=testprofile sls --stage=test deploy
testprofile is a separate AWS account and was not linked in any way to serverless pro dashboard. Yesterday morning the command worked fine and deployed to the correct AWS account.
Today, after the new UI being enabled on our account yesterday afternoon, I run the same command, I get various errors like:
Serverless Domain Manager: NotFoundException: Invalid domain name identifier specified (using a custom domain)
ServerlessError: Stack with id test-vpc does not exist (using a cf: variable)
etc.
Basically its looking in the WRONG aws account.
I have pulled the serverless code apart and I can see that the enterprise-plugin is sending credentials early in the setup, and these are not correct. The code in aws provider.js that loads from AWS_PROFILE does not get called.
If I disable this line in serverless/lib/plugins/aws/provider.js: in getCredentials():
if (this.cachedCredentials) return this.cachedCredentials;
Then it works perfectly.
So has there ALSO been a change about how the CLI uses AWS_PROFILE and providers in the serverless dash?
Arh ok, this started working again once we ‘relinked’ the AWS providers. We were worried about doing this as we were not sure whats going on in the background and as other things had appeared to break, we did not want to.
It appears that the setting of the ‘provider’ in the serverless UI is always used regardless of the AWS_PROFILE env used in the CLI.
I have a service with 3 stages:
prod
dev
test
Now test is a dynamic stage, it does not have a provider setup in the serverless UI. Yesterday I could deploy using AWS_PROFILE=testprofile and it worked and deployed to the correct AWS account.
However today it wont work unless I create an provider in the serverless UI and link it to this service → stage.
When I try to deploy without linking a provider in the UI, using AWS_PROFILE, I can see that its looking in the wrong AWS account, and I am getting:
ServerlessError: Stack with id test-vpc does not exist
I just encountered the same problem and can’t deploy to my development with local credentials. Just upgraded to the latest CLI and when I run it, it now prints out that it is using provider credentials configured via dashboard.
Also with dashboard provider credentials I’m stuck with production credentials. Meaning that even if CLI informs me with an URL to dashboard that it is using dev credentials, it still uses production credentials.
Any hints what I could try to overcome this problem?
In general I gave up trying to manage deployments via the CLI and had to make sure all providers are set up in the serverless web app.
Its already causes a few issues for us.
The bigger issue is parameters for us. As we have 10s of services, its basically an unmanagable mess managing config for each service and stage in the UI. Serverless appears to be focusing on small services rather than serious use cases.