CloudFormation:Lambda无法假定为该函数定义的角色

时间:2016-08-23 02:49:48

标签: amazon-web-services amazon-cloudformation

我一直在寻找这个错误,并没有真正回答我如何使用我的CloudFormation模板修复它。从事件日志中,我可以看到角色是在Lambda函数之前创建的。

你能帮忙吗?

1 个答案:

答案 0 :(得分:2)

您可能错过了一个AssumeRolePolicyDocument,允许Lambda(lambda.amazonaws.com)承担您的IAM角色。

示例:

<!DOCTYPE html>
<html>
 <head>
  <meta charset = "utf-8">
  <meta http-equiv = "X-UA-Compatible" content = "IE = edge">
  <meta name = "viewport" content = "width = device-width, initial-scale = 1">
  <link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
  <title>TekDays - The Community is the Conference!</title>

 </head>
  <body>
   <div class="container">
    <table class="table table-bordered">
     <thead>
      <tr>
       <th>FirstName</th>
       <th>FirstName</th>
      </tr>
     </thead>
     <tr>
      <td>Mammad</td>
      <td>mammadii</td>
     </tr>
     <tr>
      <td>Akbar</td>
       <td>Akbarii</td>
     </tr>
    </table>
  </div>
 </body>