gpt4 book ai didi

amazon-web-services - 如何启动具有包依赖项的AWS云形成堆栈?

转载 作者:行者123 更新时间:2023-12-03 07:30:45 25 4
gpt4 key购买 nike

我正在尝试让这个仓库继续运行:https://github.com/mydatastack/google-analytics-to-s3 .

一个link is provided to launch the AWS CloudFormation stack但它不再工作,因为包含模板的 S3 存储桶不再事件。

因此,我尝试通过 sam deploy --guided 自己启动堆栈。这开始构建堆栈,但中途失败并出现以下错误:

C:\Users\Me\GAS3\cloudformation>sam deploy --guided

Configuring SAM deploy
======================

Looking for config file [samconfig.toml] : Found
Reading default arguments : Success

Setting default arguments for 'sam deploy'
=========================================
Stack Name [GA_2_S3]:
AWS Region [eu-central-1]:
Parameter Name [pipes]:
Parameter Stage [local]:
Parameter AdminEmail [<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c5acaba3aa85b5b7aaafa0a6b1eba6aaa8" rel="noreferrer noopener nofollow">[email protected]</a>]:
Parameter FallbackEmail [<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3daddd5dcf3c3c1dcd9d6d0c79dd0dcde" rel="noreferrer noopener nofollow">[email protected]</a>]:
Parameter S3AlarmPeriod [60]:
#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
Confirm changes before deploy [Y/n]: y
#SAM needs permission to be able to create roles to connect to the resources in your template
Allow SAM CLI IAM role creation [Y/n]: y
Save arguments to configuration file [Y/n]: y
SAM configuration file [samconfig.toml]:
SAM configuration environment [default]:

Looking for resources needed for deployment: Found!

Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-1vcjy21utm1w6
A different default S3 bucket can be set in samconfig.toml

Saved arguments to config file
Running 'sam deploy' for future deployments will use the parameters saved above.
The above parameters can be changed by modifying samconfig.toml
Learn more about samconfig.toml syntax at
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html


File with same data already exists at GA_2_S3/d5396e95465bde0f60dbd769db9fe763, skipping upload
File with same data already exists at GA_2_S3/df3bbd85d54385405a650fc656f1ac19, skipping upload
File with same data already exists at GA_2_S3/2c01865beec56ebee30ae5b24e6f50e3, skipping upload
File with same data already exists at GA_2_S3/4adb166d233b6e3a1badf491522b0bcc, skipping upload
Error: Unable to upload artifact ./collector-ga.yaml referenced by Location parameter of GoogleAnalyticsCollectorStack resource.
Unable to upload artifact ../functions/lambda-layers/paramiko/ referenced by ContentUri parameter of SFTPLayer resource.
Parameter ContentUri of resource SFTPLayer refers to a file or folder that does not exist C:\Users\Me\GAS3\functions\lambda-layers\paramiko

检查文件夹,GitHub 上没有 ./lambda-layers/ 文件夹或 paramiko 包。我尝试从 GitHub 下载 paramiko 包,然后创建引用的 /functions/lambda-layers/paramiko/ 但这不起作用。

查看./collector-ga.yaml,这是失败的部分:

  SFTPLayer:
Condition: SFTPUploadActivate
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: paramiko
Description: paramkio lib for sftp connect
ContentUri: ../functions/lambda-layers/paramiko/
CompatibleRuntimes:
- python3.7
LicenseInfo: MIT should be added here
RetentionPolicy: Retain

为 paramiko 提供的 ContentUri 位置在 GitHub 上不存在,因此必须以其他方式构建它,因为原始存储库旨在通过单击按钮来启动工作堆栈。

我的问题是:如何使用所需的 paramiko 包启动此堆栈?

最佳答案

My question is: how do I launch this stack with the required paramiko package?

您需要适当的部署管道。如果您在 AWS 上,则可以使用 AWS CodePipeline 部署 lambda 函数。由于您具有构建依赖项,因此您需要一个构建阶段来实际获取并构建 lambda 部署包或层所需的所有内容。

或者您可以使用某些预构建或公共(public)中的paraminco,例如 this one 。这样您就可以将代码与依赖项解耦。

关于amazon-web-services - 如何启动具有包依赖项的AWS云形成堆栈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68612100/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com