Hi,
I’m new here, and I’m a little bit lost
This question has already been asked(Error: Bucket already exists when redeployed) , but the solution in the answer doesn’t seem to work for me.
# serverless.yml
service: my-app
provider:
name: aws
runtime: nodejs8.10
stage: dev
region: us-west-2
vpc:
securityGroupIds:
- sg-xxxxxxxxx
subnetIds:
- subnet-xxxxxx
- subnet-xxxxxx
- subnet-xxxxxx
functions:
app:
handler: index.handler
events:
- http: ANY /
- http: 'ANY {proxy+}'
resize:
handler: resize.handler
events:
- s3: photos
resources:
Resources:
S3BucketPhotos:
Type: AWS::S3::Bucket
Properties:
BucketName: my-bucket
ResizeLambdaPermissionPhotosS3:
Type: "AWS::Lambda::Permission"
Properties:
FunctionName:
"Fn::GetAtt":
- ResizeLambdaFunction
- Arn
Principal: "s3.amazonaws.com"
Action: "lambda:InvokeFunction"
SourceAccount:
Ref: AWS::AccountId
SourceArn: "arn:aws:s3:::my-bucket"
plugins:
- serverless-offline
When I remove the Resources section, it deploys but the bucket is not created and the triggers for that bucket are not set.