# How to reference Cognito or DynamoDB resources not deployed via YML

**URL:** <https://forum.serverless.com/t/how-to-reference-cognito-or-dynamodb-resources-not-deployed-via-yml/12111>\
**Category:** Serverless Framework\
**Created:** [July 26, 2020, 9:45am UTC](https://forum.serverless.com/t/how-to-reference-cognito-or-dynamodb-resources-not-deployed-via-yml/12111 "2020-07-26T09:45:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinhalford](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/martinhalford/32/4432_2.png) [@martinhalford](https://forum.serverless.com/u/martinhalford)\
**Post date:** [July 26, 2020, 9:45am UTC](https://forum.serverless.com/t/how-to-reference-cognito-or-dynamodb-resources-not-deployed-via-yml/12111/1 "2020-07-26T09:45:13Z")

</div>

Hi there,

Our Cognito resource is configured manually and being accessed by multiple systems.

We’d like our serverless.yml to reference the existing Cognito resource without trying to deploy a new Cognito resource. Similarly for our DynamoDB.

We have separate Serverless.YML files for deploying and removing these resources.

I’ve tried simply specifying the ARNs in place of the:

```
Fn::GetAtt:
          - MyAppsUserPool
          - Arn

```

but this fails.

Has anyone else tried this or had success doing this?

…Martin

---

<div class="post-metadata">

**Author:** ![alexvdvalk](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/alexvdvalk/32/4449_2.png) [@alexvdvalk](https://forum.serverless.com/u/alexvdvalk)\
**Post date:** [July 29, 2020, 7:07am UTC](https://forum.serverless.com/t/how-to-reference-cognito-or-dynamodb-resources-not-deployed-via-yml/12111/3 "2020-07-29T07:07:51Z")

</div>

Serverless uses Cloudformation under the hood. I was able to accomplish your scenario using Cloudformation Outputs in my ‘parent’ yaml file, and then referencing the outputs in my ‘child’ yaml files that need them, with the variables tools listed here.

> **[Serverless Variables](https://www.serverless.com/framework/docs/providers/aws/guide/variables/)**
>
> How to use Serverless Variables to insert dynamic configuration info into your serverless.yml

  
[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html)

---

<div class="post-metadata">

**Author:** ![martinhalford](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/martinhalford/32/4432_2.png) [@martinhalford](https://forum.serverless.com/u/martinhalford)\
**Post date:** [July 29, 2020, 10:03am UTC](https://forum.serverless.com/t/how-to-reference-cognito-or-dynamodb-resources-not-deployed-via-yml/12111/4 "2020-07-29T10:03:19Z")

</div>

Thanks @alexvdvalk. I’ll try that approach. Much appreciated.

---

<div class="post-metadata">

**Author:** ![aheissenberger](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/aheissenberger/32/530_2.png) [@aheissenberger](https://forum.serverless.com/u/aheissenberger)\
**Post date:** [August 10, 2020, 9:36am UTC](https://forum.serverless.com/t/how-to-reference-cognito-or-dynamodb-resources-not-deployed-via-yml/12111/5 "2020-08-10T09:36:25Z")

</div>

If you deployed the dynamoDB with a stack (cloudformation template), the stack can output and export a global identifier which you can then user in your serverless configuration.

[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html)
