使用.ebextensions创建资源失败

时间:2015-05-27 00:01:55

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

我正在尝试使用.ebextensions中的配置文件在一个简单的节点项目中创建一个DynamoDB表。该应用程序成功启动,但表永远不会创建。我的项目结构如下所示:

app/
  .elasticbeanstalk/
    config.yml
  .ebextensions/
    setup.config
  app.js

setup.config包含以下内容:

Resources:
  StartupSignupsTable:
    Type: AWS::DynamoDB::Table
    Properties:
      KeySchema:
        HashKeyElement:
          AttributeName: "email"
          AttributeType: "S"
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1

然后我运行以下命令来创建一个新的elasticbeanstalk应用程序:

git init
eb init
git add *
git commit -m "Initial commit."
eb create

应用程序启动,但有错误:

ERROR: Creating security group named: sg-8c926717 failed Reason: Resource creation cancelled
ERROR: Stack named 'awseb-f-nrju2hums2-stack' aborted operation. Current state: 'CREATE_FAILED'  
Reason: The following resource(s) failed to create: [StartupSignupsTable, AWSEBLoadBalancerSecurityGroup].
INFO: Launched environment: test-dev. However, there were issues during launch. See event log for details.
ERROR: The operation timed out. The state of the environment is unknown.

有没有人知道是什么阻止了桌子的制作?我正在使用具有完全DynamoDB权限的修改后的EB IAM角色。非常感谢!

1 个答案:

答案 0 :(得分:1)

我弄清楚出了什么问题。原来我与eb CLI关联的用户没有相应的权限来创建DynamoDB表。添加DynamoDB:CreateTable策略修复了问题。