# Serverless Deploy Skip custom

**URL:** <https://forum.serverless.com/t/serverless-deploy-skip-custom/1994>\
**Category:** Serverless Framework\
**Created:** [June 1, 2017, 11:40pm UTC](https://forum.serverless.com/t/serverless-deploy-skip-custom/1994 "2017-06-01T23:40:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimo](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kimo](https://forum.serverless.com/u/kimo)\
**Post date:** [June 1, 2017, 11:40pm UTC](https://forum.serverless.com/t/serverless-deploy-skip-custom/1994/1 "2017-06-01T23:40:50Z")

</div>

Hi all,

I dunno how but i could not find an answer to this online. Seems like a very simple thing though.

in my `serverless.yml` file i got the following

```auto
custom:
  dynamodb:
    start:
      port: 8000
      inMemory: true
      migrate: true
      seed: true
      sharedDB: true

```

When ever i deploy to `--stage prod` i comment out the `custom` section.

How do we solve this issue. Frankly i read about `variables` but i could not get how works really.

Any guidance is appreciated

Cheers

---

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [June 2, 2017, 3:08am UTC](https://forum.serverless.com/t/serverless-deploy-skip-custom/1994/2 "2017-06-02T03:08:55Z")

</div>

Can you wrap your YAML in ```yaml and ``` so that the formatting is maintained.

You probably probably want something like this:

```auto
custom:
  stage: "${opt:stage, self:provider.stage}"
  dynamodb: ${self:custom.${self:custom.stage}.dynamodb}
  prod:
    dynamodb:
  dev:
    dynamodb:
      start:
        port: 8000
        inMemory: true
        migrate: true
        seed: true
        sharedDB: true

```

---

<div class="post-metadata">

**Author:** ![kimo](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kimo](https://forum.serverless.com/u/kimo)\
**Post date:** [June 4, 2017, 11:00pm UTC](https://forum.serverless.com/t/serverless-deploy-skip-custom/1994/3 "2017-06-04T23:00:21Z")

</div>

First it seems the code edit is not allowing for the `yaml` format. Sorry mate.

Second, thanks, i think i got how it works. will give it a shot

---

<div class="post-metadata">

**Author:** ![kimo](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kimo](https://forum.serverless.com/u/kimo)\
**Post date:** [June 7, 2017, 4:21am UTC](https://forum.serverless.com/t/serverless-deploy-skip-custom/1994/4 "2017-06-07T04:21:09Z")

</div>

In case someone finds this post here goes a good solution

in the `serverless.yml` add the following

```auto
custom:
  envs: ${file(envs/env.${opt:stage, self:provider.stage}.yml)}

```

add `envs/env.dev.yml`, `envs/env.prod.yml`

You can now access the contents as follows

```auto
functions:
  hello:
    handler: handers/hello.world
    environment:
      name: ${self:custom.envs.name}

```

in your `hello.js` in `world` you can access `name` like `process.env.name`

hope this helps someone someday
