Give an S3 Bucketname a unique ID or Unique ID on serverless config files?

I’m trying to give a unique ID suffix to an S3 bucket name.
I’ve tried the following:

BucketName: name-{"Ref": "AWS::StackId"}'
BucketName: { 'Fn::Join': [':', ['name:', { Ref: 'AWS:StackId' }]] }
BucketName: 
    Fn::Join:
      - - ""
      - - ""
        - Ref: "AWS::StackId"

None of those worked.
It doesn’t have to be AWS:StackId, I just figured it’s the most obvious unique identifier for a deployment, though I’m open to other unique ID options…

Any ideas?

1 Like