使用 .ebextensions 创建资源失败

Resource creation failed using .ebextensions

我正在尝试使用 .ebextensions 中的配置文件在基本节点项目中创建 DynamoDB table。该应用程序成功启动,但 table 从未创建。我的项目结构如下所示:

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.

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

我已经弄清楚出了什么问题。原来我与 eb CLI 关联的用户没有创建 DynamoDB 表的适当权限。添加 DynamoDB:CreateTable 策略解决了问题。