# Serverless.ts - config file: How to reference an sns or sqs resource in the lambda destination

**URL:** <https://forum.serverless.com/t/serverless-ts-config-file-how-to-reference-an-sns-or-sqs-resource-in-the-lambda-destination/15541>\
**Category:** Serverless Framework\
**Tags:** aws, variables\
**Created:** [July 12, 2021, 12:52pm UTC](https://forum.serverless.com/t/serverless-ts-config-file-how-to-reference-an-sns-or-sqs-resource-in-the-lambda-destination/15541 "2021-07-12T12:52:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.schubert](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/m.schubert/32/5985_2.png) [@m.schubert](https://forum.serverless.com/u/m.schubert)\
**Post date:** [July 12, 2021, 12:52pm UTC](https://forum.serverless.com/t/serverless-ts-config-file-how-to-reference-an-sns-or-sqs-resource-in-the-lambda-destination/15541/1 "2021-07-12T12:52:05Z")

</div>

Hi there serverless community,  
i am using the serverless.ts config currently.  
i couldn’t find much examples in the documentation how to use the ts syntax to reference an sns or sqs resource by its template name for a lambda destination. Would something like this work?

i want to achieve that i can create a stage based name for the SNS or SQS service and reference that name as a lambda destination for onSuccess or onFailurea

this is just an example for the config …

 ![Screenshot 2021-07-12 at 14.48.41](https://canada1.discourse-cdn.com/flex036/uploads/serverless/original/2X/6/6011845a38d84142821583b58a6a62c8b905ffd0.png)

the names of the sns and sqs resources are created via environment variables that also take into account the stage parameters.

thanks for help!
