如何使用胶水启动 AWS cloudformation 堆栈?

How to launch AWS cloud formation stack with glue?

我正在努力让这个 repo 继续:https://github.com/mydatastack/google-analytics-to-s3

A link is provided to launch the AWS CloudFormation stack,本来是单击一下即可启动堆栈,但它不再工作,因为包含该模板的 S3 存储桶不再处于活动状态。

因此,我尝试通过 sam deploy --guided --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM 自己启动堆栈,因为堆栈的所有资源都在回购协议中。我添加了 this lambda layer for the paramiko package referenced by collector-ga.yaml to .

令人沮丧的是,我还没有完全起床 运行,GlueConfigurationLambdaAWS lambda function (line 691) 创建失败:

Waiting for changeset to be created..

CloudFormation stack changeset
---------------------------------------------------------------------------------------------------------------------
Operation                     LogicalResourceId             ResourceType                  Replacement
---------------------------------------------------------------------------------------------------------------------
+ Add                         GoogleAnalyticsCollectorSta   AWS::CloudFormation::Stack    N/A
                              ck
---------------------------------------------------------------------------------------------------------------------

Changeset created successfully. arn:aws:cloudformation:eu-central-1:XXXXXX:changeSet/samcli-deploy1628597635/4ee26e-46b5-4131-bdba-1b9fc34f99d6


Previewing CloudFormation changeset before deployment
======================================================
Deploy this changeset? [y/N]: y

2021-08-10 13:14:04 - Waiting for stack create/update to complete

CloudFormation events from changeset
---------------------------------------------------------------------------------------------------------------------------------------------------------
ResourceStatus                         ResourceType                           LogicalResourceId                      ResourceStatusReason
---------------------------------------------------------------------------------------------------------------------------------------------------------
CREATE_IN_PROGRESS                     AWS::CloudFormation::Stack             GoogleAnalyticsCollectorStack          -
CREATE_IN_PROGRESS                     AWS::CloudFormation::Stack             GoogleAnalyticsCollectorStack          Resource creation Initiated
CREATE_FAILED                          AWS::CloudFormation::Stack             GoogleAnalyticsCollectorStack          Embedded stack
                                                                                                                     arn:aws:cloudformation:eu-central-1:
                                                                                                                     XXXXXX:stack/GAN2S3-GoogleAnal
                                                                                                                     yticsCollectorStack-JUATDT3EBD82/e19
                                                                                                                     a4950-ff27-11ea-943e-06072e1f2808
                                                                                                                     was not successfully created: The
                                                                                                                     following resource(s) failed to
                                                                                                                     create: [GlueConfigurationLambda].

完整跟踪 - https://pastebin.pl/view/50b3e402

  1. 我的第一个问题是是否有任何地方可以获得更深入的错误日志?
  2. 我的第二个问题是是否有人知道如何修复此错误。

您能看一下 AWS 控制台 CloudFormation 应用程序吗?您应该能够选择查看已删除的堆栈,之后您应该能够 select 失败的子堆栈。在该已删除堆栈的事件列表中,您应该能够查看更准确的错误信息。

如果那个确切的错误仍然不清楚,请随时编辑问题以添加具体错误,并对此答案添加评论以引起我的注意。

(编辑)

我再次查看了模板文件,发现失败的 Lambda 仍配置为使用 Node.js 8,它已被弃用一段时间。您应该将其更改为较新的版本,例如 Node.js 14。 在此处查找当前支持的运行时:Lambda runtimes