The error message says what the issue is:
S3BucketName already exists. However CloudFormation should know that it already created the bucket, and not attempt to create it again on a subsequent deployment. So this is certainly not the expected behaviour.
Can you confirm 2 things:
- As asked by @buggy, are you sure you are using the same account and region for the first and second deployments?
- Have you manually changed anything via the AWS console or cli?
The reason for checking account and region is, deploying to a different region (or account) will create a new stack which won't "know" that the S3 bucket was already created in the first stack. If you are deploying to multiple regions, then you need to either have a bucket per region (include the region in the bucket name), or if you want to use a common bucket, you need to have one stack that creates the bucket and exports it (using
Outputs) for other stacks to use. If you are planning on using the serverless config to create the same service in multiple AWS accounts, then you want to put the account id, or some other, account-specific parameter (e.g. given as an option to the
serverless command) into the bucket name.
Assuming that's not the problem, I would log into the console and go to CloudFormation, and check:
- Whether the stack you are deploying to is the stack that is listed there (or if there are multiple stacks when there should be one, maybe that is the cause).
- Whether the S3 bucket is indeed listed under that stack (under Resources).