# Function name dilemma when deploying with both cloudformation and only function code

**URL:** <https://forum.serverless.com/t/function-name-dilemma-when-deploying-with-both-cloudformation-and-only-function-code/11975>\
**Category:** Serverless Framework\
**Tags:** aws, lambda\
**Created:** [July 9, 2020, 5:40am UTC](https://forum.serverless.com/t/function-name-dilemma-when-deploying-with-both-cloudformation-and-only-function-code/11975 "2020-07-09T05:40:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluermind](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@bluermind](https://forum.serverless.com/u/bluermind)\
**Post date:** [July 9, 2020, 5:40am UTC](https://forum.serverless.com/t/function-name-dilemma-when-deploying-with-both-cloudformation-and-only-function-code/11975/1 "2020-07-09T05:40:36Z")

</div>

Hi I am working on deploying a lambda function. My company has a naming convention which restricts the functions to have the words separated by dashes (-). However this causes serverless deploy to create weird names when cloudformation starts auto generating names. So within the serverless.yml, I name my functions to be camelCased but on the name attribute I give a value so that it follows the naming convention.

```
....
functions:
    functionDoIt:
        name: company-function-do-it-lambda
....

```

This deploys fine. Function is created successfully with the intended naming rule.

However our CI/CD process does not incorporate running the deploy command again (as normally we would only be doing an update to our functions). Hence we would run ‘serverless deploy function --function …’ during the consequent deployments after the lambda is initially set up.  
But then if we were to do

```
serverless deploy function --function functionDoIt

```

This will incur an error since the lambda is actually named company-function-do-it-lambda.

```
serverless deploy function --function company-function-do-it-lambda

```

Above will also incur an error since there is no function under functions defined in the serverless.yml

So I want to be able to deploy function with serverless like using the aws cli - 'aws lambda update-function-code … ’

If I must abide by the convention, is there no way to use the serverless deploy function? Or are there better suggestions?
