# Beginner Question: Mutliple services using the same resources

**URL:** <https://forum.serverless.com/t/beginner-question-mutliple-services-using-the-same-resources/884>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [December 5, 2016, 5:55pm UTC](https://forum.serverless.com/t/beginner-question-mutliple-services-using-the-same-resources/884 "2016-12-05T17:55:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tehael](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tehael/32/327_2.png) [@tehael](https://forum.serverless.com/u/tehael)\
**Post date:** [December 5, 2016, 5:55pm UTC](https://forum.serverless.com/t/beginner-question-mutliple-services-using-the-same-resources/884/1 "2016-12-05T17:55:12Z")

</div>

Hi there,

sorry if my questions sounds stupid, or if it has been answered yet. I was searching Google, StackOverflow and this forum without success.

In the most simple terms I need to build the system like this:

- CSV-file gets downloaded by FTP parsed and data save in a dynamodb
- API provides read and update access to the data, data gets enriched by some users inputs (API is consumed by a WebClient)
- enriched data is exported into another CSV-file to be downloaded

I thought it would be a good idea, to separate these concerns into 3 serverless-services containing one or more functions:

- Import service (one scheduled function for downloading csv to s3, one function for parsing csv and (perhaps another one for) saving data to DynamoDB)
- API service (at least one function to list data and one to update data)
- Export service (one scheduled function to read updated data an export csv to s3)

From the serverless-framework documentation I understand that each service has it own resources. But on the other hand all those services (and their respektive functions) need the same DynamoDB tables.

So my questions:

- Am I able to create some kind of shared resources?
- And If so, how?
- If not, I figured I put all my functions in the same serverless-service, right? If so, how am I able to at least put them in some kind of namespace to make the distinction clear?

Hope someone could shed some light on this.

Kind regards

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [December 5, 2016, 10:41pm UTC](https://forum.serverless.com/t/beginner-question-mutliple-services-using-the-same-resources/884/2 "2016-12-05T22:41:35Z")

</div>

You can create Services with no functions thanks to @johncmckim’s [PR](https://github.com/serverless/serverless/pull/2499) for your shared resources.

You would then set the shared resources’ details [as variables](https://serverless.com/framework/docs/providers/aws/guide/variables/) and pass them off to your code with [environment variables](https://serverless.com/framework/docs/providers/aws/guide/variables#referencing-environment-variables).

---

<div class="post-metadata">

**Author:** ![tehael](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/tehael/32/327_2.png) [@tehael](https://forum.serverless.com/u/tehael)\
**Post date:** [December 6, 2016, 7:11pm UTC](https://forum.serverless.com/t/beginner-question-mutliple-services-using-the-same-resources/884/3 "2016-12-06T19:11:24Z")

</div>

Thank your very much, for your response.

Okay, nice…I was thinking about an function-less service for the resources.

I’m not sure if I understand the documentation. What I figured:

1. create a service name resources and in the resource/serverless.yml define the something like

- 

1. in the say they api/serverless.yaml I reference it like

Optionally I would define custom variables in the resources/serveless.yml so the path to reference is a little shorter.  
Did I get that more or less correctly?

Kind regard, thomas

P.S.:  
I’m coming from In serverless 0.5.6. There were the CloudFormation-Outputs which were stored in \_meta and could be used and referenced as environment variables. Especially when ARNs are needed this comes in handy, right?  
Does serverless-1.x handle it in a similar way? Or how do I get the details in to variables and into the environment of the other services?

---

<div class="post-metadata">

**Author:** ![miguelperez](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/miguelperez/32/524_2.png) [@miguelperez](https://forum.serverless.com/u/miguelperez)\
**Post date:** [March 19, 2017, 8:41pm UTC](https://forum.serverless.com/t/beginner-question-mutliple-services-using-the-same-resources/884/4 "2017-03-19T20:41:22Z")

</div>

Hi, I was wondering the same thing did it work for you?

Thanks,
