【问题标题】:Trouble creating DynamoDB on AWS Elastic Beanstalk with Python使用 Python 在 AWS Elastic Beanstalk 上创建 DynamoDB 时遇到问题
【发布时间】:2015-04-06 00:24:25
【问题描述】:

我正在尝试将我的 Python Flask 应用程序部署到 Elastic Beanstalk 并在配置文件中创建一个 DynamoDB 表和 SQS 队列。我已经像这样设置了我的配置文件(类似于https://github.com/awslabs/eb-py-flask-signup/blob/master/.ebextensions/setup.config):

Resources:
  EmailsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      KeySchema:
        HashKeyElement:
          AttributeName: "email"
          AttributeType: "S"
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
  NewBatchQueue:
    Type: "AWS::SQS::Queue"

files:
  "/var/app/app.config":
    mode: "000444"
    owner: "apache"
    group: "apache"
    content: |
      AWS_REGION = '`{ "Ref" : "AWS::Region"}`'
      EMAIL_TABLE = '`{ "Ref" : "EmailsTable"}`'

option_settings:
  "aws:elasticbeanstalk:application:environment":
    "APP_CONFIG": "/var/app/app.config"

我已将默认角色策略设置为接受 DynamoDB(即通过允许 dynamodb:"*"),但是当我使用 git aws.push 推送时,我的 AWS 控制台上出现以下错误:Service:AmazonCloudFormation, Message:Stack named 'awseb-e-79sqgmxq6p-stack' aborted operation. Current state: 'UPDATE_ROLLBACK_IN_PROGRESS' Reason: The following resource(s) failed to create: [EmailsTable].

对于为什么会发生这种情况有什么想法吗?

【问题讨论】:

    标签: python amazon-web-services flask amazon-elastic-beanstalk amazon-dynamodb


    【解决方案1】:

    没关系,原来我有一个缩进错误。线条

    ProvisionedThroughput:
      ReadCapacityUnits: 1
      WriteCapacityUnits: 1
    

    应该缩进一个

    【讨论】:

      猜你喜欢
      • 2020-08-19
      • 2016-09-16
      • 2017-12-30
      • 2015-06-28
      • 2018-11-09
      • 1970-01-01
      • 2017-03-11
      • 2018-08-06
      • 2019-08-11
      相关资源
      最近更新 更多