Hi, this might be a Cloudformation problem, but as I use Cloudformation only through serverless, I start asking here:
On my way to try walking through a tutorial for a serverless service to write to S3 (https://www.netlify.com/blog/2016/11/17/serverless-file-uploads/ ) I bump into the situation that I cannot deploy my service again.
When running deploy, I get an error message:
“An error occurred while provisioning your stack: UploadBucket
- slsupload already exists.”
I also executed the remove command, which seemed to run successful, at least no error message.
In the cloudformation stack view in the aws web interface it clearly said that it also remove the S3 resource successfully.
I the S3 webinterface on AWS there is no Bucket with either the name slsupload nor UploadBucket (I am not sure under which name it is supposed to appear).
My questions are:
- were do I actually see this bucket in S3
- why is it not deleted with sls remove?
- are these cloudformation resources not idempotent?
my serverless.yml is:
service: s3-writer-test
provider:
name: aws
runtime: nodejs6.10
region: eu-central-1
iamRoleStatements:
- Effect: "Allow"
Action:
- “s3:"
Resource: "arn:aws:s3:::slsupload/”
functions:
writeme:
handler: handler.writeme
events:
- http:
path: writeme
method: get
resources:
Resources:
UploadBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: slsupload
AccessControl: PublicRead
CorsConfiguration:
CorsRules:
- AllowedMethods:
- GET
- PUT
- POST
- HEAD
AllowedOrigins:
- “"
AllowedHeaders:
- "”