# Serverless.ts : How to use !Sub or Fn::Sub when resolving pseudo parameters ${AWS:AccountId} in typescript?

**URL:** <https://forum.serverless.com/t/serverless-ts-how-to-use-sub-or-fn-sub-when-resolving-pseudo-parameters-aws-accountid-in-typescript/15545>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [July 13, 2021, 9:42am UTC](https://forum.serverless.com/t/serverless-ts-how-to-use-sub-or-fn-sub-when-resolving-pseudo-parameters-aws-accountid-in-typescript/15545 "2021-07-13T09:42:16Z")\
**Posts on this page:** 2\
**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 13, 2021, 9:42am UTC](https://forum.serverless.com/t/serverless-ts-how-to-use-sub-or-fn-sub-when-resolving-pseudo-parameters-aws-accountid-in-typescript/15545/1 "2021-07-13T09:42:16Z")

</div>

hi there,  
i can’t get my head around on how to reference the new built in pseudo parameters support in a serverless.ts file so that the ${AWS:AccountId} gets substituted correctly within a serverless.ts (typescript) config file.

Thanks for any help and suggestions:

 ![Screenshot 2021-07-13 at 10.48.00](https://canada1.discourse-cdn.com/flex036/uploads/serverless/original/2X/3/3cdf71d3cf385015883f3fb942b6bc059eabdd39.png)

---

<div class="post-metadata">

**Author:** ![tobennanwokike](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tobennanwokike/32/6107_2.png) [@tobennanwokike](https://forum.serverless.com/u/tobennanwokike)\
**Post date:** [August 21, 2021, 11:51am UTC](https://forum.serverless.com/t/serverless-ts-how-to-use-sub-or-fn-sub-when-resolving-pseudo-parameters-aws-accountid-in-typescript/15545/3 "2021-08-21T11:51:18Z")

</div>

Hi @m.schubert I was also looking for a solution to this and I came across your question. I was able to resolve it and I see that the issue with yours is that you are wrapping the line that contains ‘Fn::Sub’ in single quotes. Here’s an example below from my code:

Resource: { ‘Fn::Sub’: ‘arn:aws:es:${self:provider.region}:${AWS::AccountId}:domain/images-search-${self:provider.stage}/\*’ }

As you can see the Object that contains ‘Fn:Sub’ is not wrapped in quotes. The link to my full serverless.ts file is [udacity-cloud-developer-serverless-lesson3/serverless.ts at main · tobennanwokike/udacity-cloud-developer-serverless-lesson3 · GitHub](https://github.com/tobennanwokike/udacity-cloud-developer-serverless-lesson3/blob/main/serverless.ts)

I hope this helps.

Happy Coding!
