小编Usa*_*jaz的帖子

无法在serverless.yml中引用cloudformation资源。变量UserPoolId的变量引用语法无效

我正在使用无服务器框架将无服务器应用程序部署到AWS。但是,cloudformation部分无法正常工作。我在网上查了一下,找不到我的Yaml有什么问题。

我正在使用Cloudformation创建UserPool,然后创建UserPoolClient。我有以下yaml用于resources:

resources:
  Resources:
    HttpBucket:
      Type: "AWS::S3::Bucket"
      Properties:
        BucketName: ${self:service}-${UserPoolId}
        AccessControl: PublicRead
        WebsiteConfiguration:
          IndexDocument: index.html
    UserPool:
      Type: "AWS::Cognito::UserPool"
      Properties:
        UserPoolName: ${self:service}-user-pool
        MfaConfiguration: "OFF"
        EmailVerificationSubject: "Your verification code"
        EmailVerificationMessage: "Your verification code is {####}. "  
        Schema:
          - Name: name
            AttributeDataType: String
            Mutable: true
            Required: true
          - Name: email
            AttributeDataType: String
            Mutable: false
            Required: true
          - Name: teamName
            AttributeDataType: String
            Mutable: true
            Required: false
          - Name: custom:supportedTeam
            AttributeDataType: String
            Mutable: true
            Required: false
          - Name: custom:payment
            AttributeDataType: String
            Mutable: true
            Required: …
Run Code Online (Sandbox Code Playgroud)

yaml amazon-web-services node.js serverless-framework serverless

5
推荐指数
1
解决办法
1457
查看次数