繁体   English   中英

使用 sam init 部署 AWS Lambda“Hello World”,sam build sam deploy defaults 失败,无法为 sam-app 创建变更集

[英]Deploying AWS Lambda "Hello World" using sam init, sam build sam deploy defaults fails with Failed to create changeset for sam-app

我按照最简单的方法在我的 PC 上创建了一个基本的 AWS lambda function - 但是当我尝试部署它时失败并显示一条模糊消息。

错误:无法为堆栈创建变更集:sam-app,调用 CreateChangeSet 操作时发生错误(InternalFailure)(达到最大重试次数:4):未知

我相信我已经提供了所有必需的权限:

  • AmazonS3 完全访问
  • AWSCodeDeployFullAccess
  • AWSLambda角色
  • AWSCloudFormationFullAccess
  • AWSLambda_FullAccess

另外:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:DetachRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:CreateRole"
            ],
            "Resource": "*"
        }
    ]
}

我的终端 session 命令和响应是:

c:\My Projects\Nuzum-AWS\sam-app>sam deploy --guided --template-file.aws-sam\build\template.yaml

配置 SAM 部署

    Looking for config file [samconfig.toml] :  Not found

    Setting default arguments for 'sam deploy'
    =========================================
    Stack Name [sam-app]:
    AWS Region [eu-west-1]:
    #Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    Confirm changes before deploy [y/N]:
    #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]:
    #Preserves the state of previously provisioned resources when an operation fails
    Disable rollback [y/N]:
    HelloWorldFunction may not have authorization defined, Is this okay? [y/N]: y
    Save arguments to configuration file [Y/n]:
    SAM configuration file [samconfig.toml]:
    SAM configuration environment [default]:

    Looking for resources needed for deployment:
     Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-dee0ker00dts
     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

上传到 sam-app/7b33e513850748d9482c8e504aacefb2 533 / 533 (100.00%)

    Deploying with following values
    ===============================
    Stack name                   : sam-app
    Region                       : eu-west-1
    Confirm changeset            : False
    Disable rollback             : False
    Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-dee0ker00dts
    Capabilities                 : ["CAPABILITY_IAM"]
    Parameter overrides          : {}
    Signing Profiles             : {}

启动部署

上传到 sam-app/4e272b888be3f30dedd7ac0cf77b1925.template 1361 / 1361 (100.00%) 错误:无法为堆栈创建变更集:sam-app,调用 CreateChangeSet 操作时发生错误(InternalFailure)(达到最大重试次数:4):未知

您将 confirm change set 的值设为 false。 你必须把它当作真的。 您可以在部署时尝试提供这些值吗?

  1. 在部署之前确认更改 [y/N]:y。
  2. 允许创建 SAM CLI IAM 角色 [Y/n]:y
  3. 禁用回滚 [y/N]:n
  4. 将 arguments 保存到配置文件 [Y/n]:y

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM