无服务器部署-LogicalResourceId

时间:2019-04-04 13:50:19

标签: python amazon-web-services serverless-framework serverless

我有以下serverless.yml文件:

https://pastebin.com/9V6AY13e

每当我部署它时,都会出现以下错误:

$args = array( 'post_type' => 'book', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
  the_title();
  echo '<div class="entry-content">';
  the_content() . the_thumbnails();
  echo '</div>';
endwhile;

谷歌搜索此错误会引发一个或两个与我得到此错误的原因无关的线程。

2 个答案:

答案 0 :(得分:0)

列出以下几行:

deadLetter:
  targetArn:
    GetResourceArn:
      arn:
        Fn::GetAtt:
         - DeadLetterSenderLoader
         - Arn

需要为:

deadLetter:
  targetArn: 'arn:${self:provider.name}:sqs:${self:provider.region}:${self:provider.accountId}:DeadLetterSenderLoader'

答案 1 :(得分:0)

AWS::SQS::Queue resource的返回值中包含Arn,因此Fn::GetAtt intrinsic function

可以对其进行访问

以下语法应该起作用:

targetArn:
  Fn::GetAtt: [DeadLetterSenderLoader, Arn]

targetArn:
  Fn::GetAtt:
    - DeadLetterSenderLoader
    - Arn