简体   繁体   English

使用Python在AWS Elastic Beanstalk上创建DynamoDB时遇到问题

[英]Trouble creating DynamoDB on AWS Elastic Beanstalk with Python

I'm trying to deploy my Python Flask application to Elastic Beanstalk and create a DynamoDB table and SQS Queue in the config file. 我正在尝试将Python Flask应用程序部署到Elastic Beanstalk并在配置文件中创建DynamoDB表和SQS队列。 I've set up my config file (similar to https://github.com/awslabs/eb-py-flask-signup/blob/master/.ebextensions/setup.config ) like this: 我已经设置了我的配置文件(类似于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"

I've set my default role policy to accept DynamoDB (ie by allowing dynamodb:"*" ), but when I push using git aws.push I get the following error on my AWS console: 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]. 我已将默认角色策略设置为接受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]. 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].

Any thoughts as to why this could be happening? 关于为什么会发生这种情况的任何想法?

Nevermind, turns out I had an indentation error. 没关系,原来我有一个缩进错误。 The lines 线

ProvisionedThroughput:
  ReadCapacityUnits: 1
  WriteCapacityUnits: 1

should have been indented one out 应该缩进一个

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

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