Usa*_*jaz 5 yaml amazon-web-services node.js serverless-framework serverless
我正在使用无服务器框架将无服务器应用程序部署到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: false
DeveloperOnlyAttribute: true
UsernameAttributes:
- email
AutoVerifiedAttributes:
- email
AdminCreateUserConfig:
InviteMessageTemplate:
EmailMessage: 'Your username is {username} and temporary password is {####}. '
EmailSubject: Your temporary password
SMSMessage: 'Your username is {username} and temporary password is {####}. '
UnusedAccountValidityDays: 7
AllowAdminCreateUserOnly: false
Policies:
PasswordPolicy:
RequireLowercase: true
RequireSymbols: false
RequireNumbers: true
MinimumLength: 6
RequireUppercase: true
UserPoolClient:
Type: "AWS::Cognito::UserPoolClient"
Properties:
ClientName: ${self:service}-client
GenerateSecret: false
UserPoolId:
Ref: UserPool
Outputs:
UserPoolId:
Value:
Ref: UserPool
Export:
Name: "UserPool::Id"
UserPoolClientId:
Value:
Ref: UserPoolClient
Export:
Name: "UserPoolClient::Id"
Run Code Online (Sandbox Code Playgroud)
UserPool指定时,我无法引用UserPoolClient(用作UserPoolId。以下内容:
UserPoolId:
Ref: UserPool
Run Code Online (Sandbox Code Playgroud)
产生错误:
变量UserPoolId的变量引用语法无效。您只能引用环境变量,选项和文件。您可以查看我们的文档以获取更多信息。
我不确定的另一件事是,我看到人们共享包含以下语法的yaml:
UserPoolId: !Ref UserPool
Run Code Online (Sandbox Code Playgroud)
但它也会失败,并会出现有关无效语法的错误(由于!Ref)。有人可以清除我的声音吗?
| 归档时间: |
|
| 查看次数: |
1457 次 |
| 最近记录: |