{"action":"closed","number":1975,"pull_request":{"url":"https://api.github.com/repos/serverless/serverless/pulls/1975","id":83016881,"html_url":"https://github.com/serverless/serverless/pull/1975","diff_url":"https://github.com/serverless/serverless/pull/1975.diff","patch_url":"https://github.com/serverless/serverless/pull/1975.patch","issue_url":"https://api.github.com/repos/serverless/serverless/issues/1975","number":1975,"state":"closed","locked":false,"title":"Add iamRoleARN to serverless.yml","user":{"login":"horike37","id":1301012,"avatar_url":"https://avatars.githubusercontent.com/u/1301012?v=3","gravatar_id":"","url":"https://api.github.com/users/horike37","html_url":"https://github.com/horike37","followers_url":"https://api.github.com/users/horike37/followers","following_url":"https://api.github.com/users/horike37/following{/other_user}","gists_url":"https://api.github.com/users/horike37/gists{/gist_id}","starred_url":"https://api.github.com/users/horike37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horike37/subscriptions","organizations_url":"https://api.github.com/users/horike37/orgs","repos_url":"https://api.github.com/users/horike37/repos","events_url":"https://api.github.com/users/horike37/events{/privacy}","received_events_url":"https://api.github.com/users/horike37/received_events","type":"User","site_admin":false},"body":"<!--\r\n1. Please check out and follow our Contributing Guidelines: https://github.com/serverless/serverless/blob/master/CONTRIBUTING.md\r\n2. Fill out the whole template so we have a good overview on the issue\r\n3. Please follow the template, otherwise we'll have to ask you to update it\r\n-->\r\n***Implementing Issue:*** #1772 \r\n\r\n## What did you implement:\r\nI  implemented #1772\r\n\r\n## How did you implement it:\r\nIf `provider > iamRoleARN` is exists in serverless.yml, all Lambdas use iamRoleARN.\r\nIf `provider > iamRoleARN` is not exists in serverless.yml, all Lambdas use the IamRoleLambda template and the IamPolicyLambda template and custom IAM policy statements.\r\n\r\n## How can we verify it:\r\nPlease settiing in serverless.yml\r\n\r\n    provider:\r\n      iamRoleARN: <Your ARN>\r\n\r\nIf `provider > iamRoleARN` is exists in serverless.yml, the cloudformation is set up below\r\n```json\r\n \"Resources\": {\r\n        \"ServerlessDeploymentBucket\": {\r\n            \"Type\": \"AWS::S3::Bucket\"\r\n        }, \r\n        \"hello\": {\r\n            \"Properties\": {\r\n                \"Code\": {\r\n                    \"S3Bucket\": {\r\n                        \"Ref\": \"ServerlessDeploymentBucket\"\r\n                    }, \r\n                    \"S3Key\": \"xxxxxxxxxx-2016-08-28T13:08:49.211Z/serverless-develop.zip\"\r\n                }, \r\n                \"FunctionName\": \"serverless-develop-dev-hello\", \r\n                \"Handler\": \"handler.hello\", \r\n                \"MemorySize\": 1024, \r\n                \"Role\": \"<your ARN>\", \r\n                \"Runtime\": \"nodejs4.3\", \r\n                \"Timeout\": 6\r\n            }, \r\n            \"Type\": \"AWS::Lambda::Function\"\r\n        }\r\n    }\r\n```\r\n\r\nIf `provider > iamRoleARN` is  not exists in serverless.yml, the cloudformation is set up below\r\n\r\n```json\r\n\"Resources\": {\r\n        \"IamPolicyLambda\": {\r\n            \"Properties\": {\r\n                \"PolicyDocument\": {\r\n                    \"Statement\": [\r\n                        {\r\n                            \"Action\": [\r\n                                \"logs:CreateLogGroup\", \r\n                                \"logs:CreateLogStream\", \r\n                                \"logs:PutLogEvents\"\r\n                            ], \r\n                            \"Effect\": \"Allow\", \r\n                            \"Resource\": \"arn:aws:logs:us-east-1:*:*\"\r\n                        }\r\n                    ], \r\n                    \"Version\": \"2012-10-17\"\r\n                }, \r\n                \"PolicyName\": \"dev-serverless-develop-lambda\", \r\n                \"Roles\": [\r\n                    {\r\n                        \"Ref\": \"IamRoleLambda\"\r\n                    }\r\n                ]\r\n            }, \r\n            \"Type\": \"AWS::IAM::Policy\"\r\n        }, \r\n        \"IamRoleLambda\": {\r\n            \"Properties\": {\r\n                \"AssumeRolePolicyDocument\": {\r\n                    \"Statement\": [\r\n                        {\r\n                            \"Action\": [\r\n                                \"sts:AssumeRole\"\r\n                            ], \r\n                            \"Effect\": \"Allow\", \r\n                            \"Principal\": {\r\n                                \"Service\": [\r\n                                    \"lambda.amazonaws.com\"\r\n                                ]\r\n                            }\r\n                        }\r\n                    ], \r\n                    \"Version\": \"2012-10-17\"\r\n                }, \r\n                \"Path\": \"/\"\r\n            }, \r\n            \"Type\": \"AWS::IAM::Role\"\r\n        }, \r\n        \"ServerlessDeploymentBucket\": {\r\n            \"Type\": \"AWS::S3::Bucket\"\r\n        }, \r\n        \"hello\": {\r\n            \"Properties\": {\r\n                \"Code\": {\r\n                    \"S3Bucket\": {\r\n                        \"Ref\": \"ServerlessDeploymentBucket\"\r\n                    }, \r\n                    \"S3Key\": \"xxxxxxxxxxx-2016-08-28T14:02:12.081Z/serverless-develop.zip\"\r\n                }, \r\n                \"FunctionName\": \"serverless-develop-dev-hello\", \r\n                \"Handler\": \"handler.hello\", \r\n                \"MemorySize\": 1024, \r\n                \"Role\": {\r\n                    \"Fn::GetAtt\": [\r\n                        \"IamRoleLambda\", \r\n                        \"Arn\"\r\n                    ]\r\n                }, \r\n                \"Runtime\": \"nodejs4.3\", \r\n                \"Timeout\": 6\r\n            }, \r\n            \"Type\": \"AWS::Lambda::Function\"\r\n        }\r\n    }\r\n```\r\n\r\n## Todos:\r\n\r\n- [x] Write tests\r\n- [x] Fix linting errors\r\n- [x] Provide verification config/commands/resources\r\n\r\n","created_at":"2016-08-28T14:11:14Z","updated_at":"2016-08-29T04:54:23Z","closed_at":"2016-08-29T04:54:23Z","merged_at":"2016-08-29T04:54:23Z","merge_commit_sha":"81e933b194ab09ecd202820e5ea41f38afd5a66d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/serverless/serverless/pulls/1975/commits","review_comments_url":"https://api.github.com/repos/serverless/serverless/pulls/1975/comments","review_comment_url":"https://api.github.com/repos/serverless/serverless/pulls/comments{/number}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/1975/comments","statuses_url":"https://api.github.com/repos/serverless/serverless/statuses/d9c62e68fb09bbbb49d814260144c46d4efb64e8","head":{"label":"horike37:issue-1772-iam-role","ref":"issue-1772-iam-role","sha":"d9c62e68fb09bbbb49d814260144c46d4efb64e8","user":{"login":"horike37","id":1301012,"avatar_url":"https://avatars.githubusercontent.com/u/1301012?v=3","gravatar_id":"","url":"https://api.github.com/users/horike37","html_url":"https://github.com/horike37","followers_url":"https://api.github.com/users/horike37/followers","following_url":"https://api.github.com/users/horike37/following{/other_user}","gists_url":"https://api.github.com/users/horike37/gists{/gist_id}","starred_url":"https://api.github.com/users/horike37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horike37/subscriptions","organizations_url":"https://api.github.com/users/horike37/orgs","repos_url":"https://api.github.com/users/horike37/repos","events_url":"https://api.github.com/users/horike37/events{/privacy}","received_events_url":"https://api.github.com/users/horike37/received_events","type":"User","site_admin":false},"repo":{"id":66753163,"name":"serverless","full_name":"horike37/serverless","owner":{"login":"horike37","id":1301012,"avatar_url":"https://avatars.githubusercontent.com/u/1301012?v=3","gravatar_id":"","url":"https://api.github.com/users/horike37","html_url":"https://github.com/horike37","followers_url":"https://api.github.com/users/horike37/followers","following_url":"https://api.github.com/users/horike37/following{/other_user}","gists_url":"https://api.github.com/users/horike37/gists{/gist_id}","starred_url":"https://api.github.com/users/horike37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horike37/subscriptions","organizations_url":"https://api.github.com/users/horike37/orgs","repos_url":"https://api.github.com/users/horike37/repos","events_url":"https://api.github.com/users/horike37/events{/privacy}","received_events_url":"https://api.github.com/users/horike37/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/horike37/serverless","description":"Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! – ","fork":true,"url":"https://api.github.com/repos/horike37/serverless","forks_url":"https://api.github.com/repos/horike37/serverless/forks","keys_url":"https://api.github.com/repos/horike37/serverless/keys{/key_id}","collaborators_url":"https://api.github.com/repos/horike37/serverless/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/horike37/serverless/teams","hooks_url":"https://api.github.com/repos/horike37/serverless/hooks","issue_events_url":"https://api.github.com/repos/horike37/serverless/issues/events{/number}","events_url":"https://api.github.com/repos/horike37/serverless/events","assignees_url":"https://api.github.com/repos/horike37/serverless/assignees{/user}","branches_url":"https://api.github.com/repos/horike37/serverless/branches{/branch}","tags_url":"https://api.github.com/repos/horike37/serverless/tags","blobs_url":"https://api.github.com/repos/horike37/serverless/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/horike37/serverless/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/horike37/serverless/git/refs{/sha}","trees_url":"https://api.github.com/repos/horike37/serverless/git/trees{/sha}","statuses_url":"https://api.github.com/repos/horike37/serverless/statuses/{sha}","languages_url":"https://api.github.com/repos/horike37/serverless/languages","stargazers_url":"https://api.github.com/repos/horike37/serverless/stargazers","contributors_url":"https://api.github.com/repos/horike37/serverless/contributors","subscribers_url":"https://api.github.com/repos/horike37/serverless/subscribers","subscription_url":"https://api.github.com/repos/horike37/serverless/subscription","commits_url":"https://api.github.com/repos/horike37/serverless/commits{/sha}","git_commits_url":"https://api.github.com/repos/horike37/serverless/git/commits{/sha}","comments_url":"https://api.github.com/repos/horike37/serverless/comments{/number}","issue_comment_url":"https://api.github.com/repos/horike37/serverless/issues/comments{/number}","contents_url":"https://api.github.com/repos/horike37/serverless/contents/{+path}","compare_url":"https://api.github.com/repos/horike37/serverless/compare/{base}...{head}","merges_url":"https://api.github.com/repos/horike37/serverless/merges","archive_url":"https://api.github.com/repos/horike37/serverless/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/horike37/serverless/downloads","issues_url":"https://api.github.com/repos/horike37/serverless/issues{/number}","pulls_url":"https://api.github.com/repos/horike37/serverless/pulls{/number}","milestones_url":"https://api.github.com/repos/horike37/serverless/milestones{/number}","notifications_url":"https://api.github.com/repos/horike37/serverless/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/horike37/serverless/labels{/name}","releases_url":"https://api.github.com/repos/horike37/serverless/releases{/id}","deployments_url":"https://api.github.com/repos/horike37/serverless/deployments","created_at":"2016-08-28T06:25:08Z","updated_at":"2016-08-28T06:25:09Z","pushed_at":"2016-08-28T13:37:40Z","git_url":"git://github.com/horike37/serverless.git","ssh_url":"git@github.com:horike37/serverless.git","clone_url":"https://github.com/horike37/serverless.git","svn_url":"https://github.com/horike37/serverless","homepage":"http://www.serverless.com","size":71124,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"serverless:master","ref":"master","sha":"7715c014fd34fc9b48401231c16ffe6c2467eed3","user":{"login":"serverless","id":13742415,"avatar_url":"https://avatars.githubusercontent.com/u/13742415?v=3","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"repo":{"id":34302698,"name":"serverless","full_name":"serverless/serverless","owner":{"login":"serverless","id":13742415,"avatar_url":"https://avatars.githubusercontent.com/u/13742415?v=3","gravatar_id":"","url":"https://api.github.com/users/serverless","html_url":"https://github.com/serverless","followers_url":"https://api.github.com/users/serverless/followers","following_url":"https://api.github.com/users/serverless/following{/other_user}","gists_url":"https://api.github.com/users/serverless/gists{/gist_id}","starred_url":"https://api.github.com/users/serverless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serverless/subscriptions","organizations_url":"https://api.github.com/users/serverless/orgs","repos_url":"https://api.github.com/users/serverless/repos","events_url":"https://api.github.com/users/serverless/events{/privacy}","received_events_url":"https://api.github.com/users/serverless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/serverless/serverless","description":"Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! – ","fork":false,"url":"https://api.github.com/repos/serverless/serverless","forks_url":"https://api.github.com/repos/serverless/serverless/forks","keys_url":"https://api.github.com/repos/serverless/serverless/keys{/key_id}","collaborators_url":"https://api.github.com/repos/serverless/serverless/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/serverless/serverless/teams","hooks_url":"https://api.github.com/repos/serverless/serverless/hooks","issue_events_url":"https://api.github.com/repos/serverless/serverless/issues/events{/number}","events_url":"https://api.github.com/repos/serverless/serverless/events","assignees_url":"https://api.github.com/repos/serverless/serverless/assignees{/user}","branches_url":"https://api.github.com/repos/serverless/serverless/branches{/branch}","tags_url":"https://api.github.com/repos/serverless/serverless/tags","blobs_url":"https://api.github.com/repos/serverless/serverless/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/serverless/serverless/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/serverless/serverless/git/refs{/sha}","trees_url":"https://api.github.com/repos/serverless/serverless/git/trees{/sha}","statuses_url":"https://api.github.com/repos/serverless/serverless/statuses/{sha}","languages_url":"https://api.github.com/repos/serverless/serverless/languages","stargazers_url":"https://api.github.com/repos/serverless/serverless/stargazers","contributors_url":"https://api.github.com/repos/serverless/serverless/contributors","subscribers_url":"https://api.github.com/repos/serverless/serverless/subscribers","subscription_url":"https://api.github.com/repos/serverless/serverless/subscription","commits_url":"https://api.github.com/repos/serverless/serverless/commits{/sha}","git_commits_url":"https://api.github.com/repos/serverless/serverless/git/commits{/sha}","comments_url":"https://api.github.com/repos/serverless/serverless/comments{/number}","issue_comment_url":"https://api.github.com/repos/serverless/serverless/issues/comments{/number}","contents_url":"https://api.github.com/repos/serverless/serverless/contents/{+path}","compare_url":"https://api.github.com/repos/serverless/serverless/compare/{base}...{head}","merges_url":"https://api.github.com/repos/serverless/serverless/merges","archive_url":"https://api.github.com/repos/serverless/serverless/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/serverless/serverless/downloads","issues_url":"https://api.github.com/repos/serverless/serverless/issues{/number}","pulls_url":"https://api.github.com/repos/serverless/serverless/pulls{/number}","milestones_url":"https://api.github.com/repos/serverless/serverless/milestones{/number}","notifications_url":"https://api.github.com/repos/serverless/serverless/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/serverless/serverless/labels{/name}","releases_url":"https://api.github.com/repos/serverless/serverless/releases{/id}","deployments_url":"https://api.github.com/repos/serverless/serverless/deployments","created_at":"2015-04-21T03:48:40Z","updated_at":"2016-08-29T04:12:09Z","pushed_at":"2016-08-29T04:54:24Z","git_url":"git://github.com/serverless/serverless.git","ssh_url":"git@github.com:serverless/serverless.git","clone_url":"https://github.com/serverless/serverless.git","svn_url":"https://github.com/serverless/serverless","homepage":"http://www.serverless.com","size":87911,"stargazers_count":10256,"watchers_count":10256,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":725,"mirror_url":null,"open_issues_count":105,"forks":725,"open_issues":105,"watchers":10256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/serverless/serverless/pulls/1975"},"html":{"href":"https://github.com/serverless/serverless/pull/1975"},"issue":{"href":"https://api.github.com/repos/serverless/serverless/issues/1975"},"comments":{"href":"https://api.github.com/repos/serverless/serverless/issues/1975/comments"},"review_comments":{"href":"https://api.github.com/repos/serverless/serverless/pulls/1975/comments"},"review_comment":{"href":"https://api.github.com/repos/serverless/serverless/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/serverless/serverless/pulls/1975/commits"},"statuses":{"href":"https://api.github.com/repos/serverless/serverless/statuses/d9c62e68fb09bbbb49d814260144c46d4efb64e8"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"flomotlik","id":132653,"avatar_url":"https://avatars.githubusercontent.com/u/132653?v=3","gravatar_id":"","url":"https://api.github.com/users/flomotlik","html_url":"https://github.com/flomotlik","followers_url":"https://api.github.com/users/flomotlik/followers","following_url":"https://api.github.com/users/flomotlik/following{/other_user}","gists_url":"https://api.github.com/users/flomotlik/gists{/gist_id}","starred_url":"https://api.github.com/users/flomotlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flomotlik/subscriptions","organizations_url":"https://api.github.com/users/flomotlik/orgs","repos_url":"https://api.github.com/users/flomotlik/repos","events_url":"https://api.github.com/users/flomotlik/events{/privacy}","received_events_url":"https://api.github.com/users/flomotlik/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":73,"deletions":49,"changed_files":2}}
{"actor":{"display_login":"flomotlik"}}