Kristina Kobydova
05/11/2022, 10:10 AMTags.of(stack).add('tag', 'value')
Is there a way to do it in sst v1.0.4. with the new functional stacks?Seth Geoghegan
05/11/2022, 2:21 PMTags
construct is an AWS CDK construct, not SST. SST is what introduces the functional style.
I suppose you could make a Tags function, and move all of your CDK Tag creation into that construct 🤷
export function MyTags({ stack, app }: StackContext) {
Tags.of(stack).add('tag1', 'value')
Tags.of(stack).add('tag2', 'value')
Tags.of(stack).add('tag3', 'value')
}
and in your index.ts
import {MyTags} from "./MyTags"
export default function main(app: App) {
app.stack(MyTags)
}
Seth Geoghegan
05/11/2022, 2:21 PMthdxr
05/11/2022, 4:18 PMstack
as the first argthdxr
05/11/2022, 4:19 PMapp.getStack(func)
function if you want to get the stack in the main fileKristina Kobydova
05/12/2022, 10:46 AM