I've added a bucket to an existing SST app but it'...
# sst
r
I've added a bucket to an existing SST app but it's not getting created when I run
sst deploy
. I don't need to have any notifications attached to it. It's just going to be used to write data as a result of a call to an endpoint (also defined in SST) Is there anything I need to other than this:
Copy code
export default class SomeStack extends sst.Stack {
  constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
    super(scope, id, props);

    const statsCsvBucket = new Bucket(this, process.env.REBOOK_STATS_BUCKET);
  }
}
t
that's what I have
fyi that second argument won't be the bucket name, just how it's reference in CF
r
Right, thanks. do I need to specify the name on the wrapped CDK construct?
t
Yeah but I usually just let it autoname and pass that name around. Here's how you'd do it though:
Copy code
const bucket = new sst.Bucket(stack, "lol", {
    s3Bucket: {
      bucketName: "lol"
    }
  })
r
Have you ever added a bucket to an existing deployed stack using this method? Just wondering if it will only create a bucket on first deploy
or maybe I'm just looking for the wrong name (hadn't digested the implication of your naming comment!)
f
@Ross Coundon, what you had should work.
r
I'm possibly being an idiot
t
Yeah I have, it'll on create it once the part that's unique is that second argument. I wouldn't pass that through the env though
r
yeah, got ya
f
Two things I’d check: 1. run
sst diff
after you add it and see if the bucket shows up 2. look at the CF template in
.build/cdk.out
and see if you spot a AWS:S3:Bucket resource with the name