簡體   English   中英

服務員 ChangeSetCreateComplete 失敗:服務員遇到終端故障 state

[英]Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state

我正在學習 CloudFormation 教程,這是我的 AWS CloudFormation 模板:

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: A starter AWS Lambda function.
Resources:
  helloworldpython3:
    Type: 'AWS::Serverless::Function'
    Properties:
      Handler: app.lambda_handler
      Runtime: python3.6
      CodeUri: src/
      Description: A starter AWS Lambda function.
      MemorySize: 128
      Timeout: 3
      Environment:
        Variables:
          TABLE_NAME: !Ref Table
          REGION_NAME: !Ref AWS::Region
      Events:
        HelloWorldSAMAPI:
          Type: Api
          Properties:
            Path: /hello
            Method: GET
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref Table

Table:
  Type: AWS::Serverless::SimpleTable
  Properties:
    PrimaryKey:
      Name: greeting
      Type: String
    ProvisionedThroughput:
      ReadCapacityUnits: 1
      WriteCapacityUnits: 1

我可以使用aws cloudformation package生成最終模板。 但是當我嘗試使用sam deploy部署它時,我從 shell 得到了這個 output:

錯誤:等待創建變更集。錯誤:無法為堆棧創建變更集:hello-world-sam,例如:Waiter ChangeSetCreateComplete 失敗:Waiter 遇到終端故障 state:對於表達式“Status”,我們匹配了預期路徑:“失敗”狀態:失敗。 原因:無效的模板屬性或屬性 [Table]

在我的情況下,cfn linter 可以使用 yaml,錯誤(使用來自 cmd 的 aws CLI)只是

服務員 ChangeSetCreateComplete 失敗:服務員遇到終端故障 state:

對於表達式“Status”,我們匹配了預期的路徑:“FAILED”

您應該檢查AWS 控制台→ CloudFormation → {stack_name} → Change Sets

我的錯誤原因在這里

狀態原因

不執行任何更新。

可能會幫助某人

您的 YAML 格式不正確:

AWSTemplateFormatVersion: "2010-09-09"
Transform: "AWS::Serverless-2016-10-31"
Description: A starter AWS Lambda function.
Resources:
  helloworldpython3:
    Type: "AWS::Serverless::Function"
    Properties:
      Handler: app.lambda_handler
      Runtime: python3.6
      CodeUri: src/
      Description: A starter AWS Lambda function.
      MemorySize: 128
      Timeout: 3
      Environment:
        Variables:
          TABLE_NAME: !Ref Table
          REGION_NAME: !Ref AWS::Region
      Events:
        HelloWorldSAMAPI:
          Type: Api
          Properties:
            Path: /hello
            Method: GET
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref Table
  Table:
    Type: AWS::Serverless::SimpleTable
    Properties:
      PrimaryKey:
        Name: greeting
        Type: String
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1

Table應該在Resources下。 使用像cfn-python-lint這樣的 linter

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM