CF config will never automatically create an S3 bucket. It sounds like Serverless is creating the bucket for you.
You can run sls --noDeploy and then look at the templates generated in the .serverless/ directory in your service’s directory, to confirm that the bucket is being defined for you.
No, no other references. It’s a bucket for me to stuff static assets into, to be served from CloudFront. As such, it’s only referenced in the CFront config (and my s3 assets config for my plugin).
Why I find peculiar is that the CloudFront config works when the bucket is not defined. I’m sure in the past CF has cracked it with me when I’ve tried to reference a S3 bucket that didn’t exist.
Yeah, it will totally do that if it doesn’t exist.
Is this bucket created outside of CFN (or left-over from an earlier
template/deploy)? Are you changing the name between deploys, or is it just
continually re-using the same, old bucket for your static files? This would
explain why it no longer gives you an error. If you change the name of the
bucket CF should point to, I would assume it will complain again.
OK, After a chance spotting that an extra bucket was created, then delete, during the deploy, I realised the problem was I didn’t have s3:PutBucketAcl permission on my deploy role.
Thanks for helping me out
Nice to know there’s someone else on here in the same timezone as I am, too
Oh wow, I really thought it would complain if it wasn’t there - maybe that’s only if it’s referred to via an alias (i.e. NOT a custom origin). Will have to go and check. At least it told you what the problem was at request time.