<@U01JVDKASAC> <@U01J5Q8HV5Z> Would you also be in...
# guide
k
@Frank @Jay Would you also be interested in a guide how to specify a custom bucket for CDK assets? This was another one of my pain points before as we might have many projects. The serverless framework allowed using 1 customizable deployment bucket for all. The current documentation covers an option for debug payloads, but not for the general CDK deployment bucket that's used for all other assets.
Copy code
cdk bootstrap --bootstrap-bucket-name [bucket-name]-[account]-[region] --tags Tag1=value --tags Tag2=value aws://[account]/[region]
parameters in [] need to be replaced
f
Hey @Klaus, CDK actually only creates 1 bucket per region per AWS account (not per app).
The
sst start
commands create an s3 bucket per app. What are the names for these buckets u r seeing in ur account?
k
Hi @Frank - yes, it created 1 bucket during bootstrap (once per region), but we like to customize the bucket name (and do tagging, which I omitted here). The we also like the asset in project specific folders, but not sure if that's a common need or not.
The synthesizer is required for each stack though, as soon as the bucket name had been customized during bootstrap. Otherwise, it just failed for me.
For background - we need to follow a naming convention for our buckets, including deployment buckets. The synthesizer seems to be the only way I found to achieve that. It get's a bit repetitive though, when splitting out stacks as each stack requires a new synthesizer instance.
The function below makes it a bit easier now and also creates project specific folders based on our APPLICATION environment variable
@Frank @thdxr perhaps having some app method for would be nice later. For now using something like
Copy code
app.stack(ApiStack, bucketSynthesizer(app)).stack(DbStack, bucketSynthesizer(app))...
is ok even when chaining several stacks