# Existing IAM role reuse syntax/behavior

**URL:** <https://forum.serverless.com/t/existing-iam-role-reuse-syntax-behavior/768>\
**Category:** Serverless Framework\
**Created:** [November 14, 2016, 7:09pm UTC](https://forum.serverless.com/t/existing-iam-role-reuse-syntax-behavior/768 "2016-11-14T19:09:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nerdguru](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/nerdguru/32/248_2.png) [@nerdguru](https://forum.serverless.com/u/nerdguru)\
**Post date:** [November 14, 2016, 7:09pm UTC](https://forum.serverless.com/t/existing-iam-role-reuse-syntax-behavior/768/1 "2016-11-14T19:09:52Z")

</div>

Hi there,

From:

> **[Serverless Framework - AWS Lambda Guide - IAM](https://www.serverless.com/framework/docs/providers/aws/guide/iam/)**
>
> How to manage your AWS Lambda functions and their AWS infrastructure resources easily with the Serverless Framework.

I ought to be able to do this in my serverless.yml file to reuse an existing IAM role for all functions within my service:

```
provider:
  name: aws
  runtime: nodejs4.3
  role: arn:aws:iam::<my account number>:role/<some role name>

```

But I’m finding that instead it creates a new custom IAM role anyway (console output):

```
Service Information
service: myFirstServerlessService
 stage: dev
region: us-east-1
api keys:
  None
endpoints:
  None
functions:
  myFirstServerlessService-dev-hello: arn:aws:lambda:us-east-1:<my account number>:function:myFirstServerlessService-dev-hello

```

Do I have the syntax wrong, do I misunderstand this feature, or have I found a bug?

---

<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:** [November 14, 2016, 11:06pm UTC](https://forum.serverless.com/t/existing-iam-role-reuse-syntax-behavior/768/2 "2016-11-14T23:06:47Z")

</div>

Your snippet looks fine, but I’m just going off the docs - I haven’t used this functionality myself.

Have you verified your function is using the newly created role (and not your specified role) via the console? The CLI output doesn’t really give enough information.

I’d start by running `serverless deploy --noDeploy` and checking the template created in `.serverless/cloudformation-template-update-stack.json` to see if your specified role ARN is referenced anywhere. If it’s not, you might have found a bug…

Are you running on the latest version of Serverless (v1.1.0)?

Update: looks like you’re not the only one having issues with it [https://github.com/serverless/serverless/issues/2706](https://github.com/serverless/serverless/issues/2706)

---

<div class="post-metadata">

**Author:** ![nerdguru](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/nerdguru/32/248_2.png) [@nerdguru](https://forum.serverless.com/u/nerdguru)\
**Post date:** [November 14, 2016, 11:15pm UTC](https://forum.serverless.com/t/existing-iam-role-reuse-syntax-behavior/768/3 "2016-11-14T23:15:06Z")

</div>

Thanks for the reply @rowanu. I upgraded to 1.1 and that didn’t solve it. Upon doing a `serverless deploy --noDeploy` I see no references to my arn in `.serverless/cloudformation-template-update-stack.json`. I’d say I found a bug then, I’ll document here in a bit.

Easy workaround, though, to manually apply the role in the Lambda console.

---

<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:** [November 14, 2016, 11:31pm UTC](https://forum.serverless.com/t/existing-iam-role-reuse-syntax-behavior/768/4 "2016-11-14T23:31:21Z")

</div>

Your other option (as mentioned in the bug report I linked above) is to run Serverless off `master` as the issue seems to be fixed there.

v1.2.0 is due out any day now, so you should be right once it’s released.
