我正在尝试使用带有以下模板的AWS CloudFormation创建Alexa技能。我使用here和--scope alexa::ask:skills:readwrite
描述的过程生成了刷新令牌。但是,当我尝试创建堆栈时,它在Alexa::ASK::Skill
上失败,并显示错误消息:
更新技能时发生错误。原因:找不到资源。
堆栈中的所有其他资源均会在AlexaSkill上失败之前成功创建。 什么可能导致该错误消息?
请注意:我已经尝试过多次了,所以不是CloudFormation错误之一。
Parameters:
SkillName:
Type: String
BucketName:
Type: String
AlexaDeveloperClientId:
Type: String
AlexaDeveloperClientSecret:
Type: String
AlexaDeveloperRefreshToken:
Type: String
AlexaDeveloperVendorId:
Type: String
Resources:
AlexaS3ReadRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- alexa-appkit.amazon.com
Action:
- sts:AssumeRole
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonS3FullyAccess
AlexaSkill:
Type: Alexa::ASK::Skill
Properties:
AuthenticationConfiguration:
ClientId: !Ref AlexaDeveloperClientId
ClientSecret: !Ref AlexaDeveloperClientSecret
RefreshToken: !Ref AlexaDeveloperRefreshToken
SkillPackage:
Overrides:
Manifest:
apis:
custom:
endpoint:
uri: !GetAtt LambdaFunction.Arn
S3Bucket: !Ref BucketName
S3BucketRole: !GetAtt AlexaS3ReadRole.Arn
S3Key: !Sub ${SkillName}_skill_package.zip
VendorId: !Ref AlexaDeveloperVendorId
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
Action:
- sts:AssumeRole
LambdaFunction:
Type: AWS::Lambda::Function
Properties:
Code:
S3Bucket: !Ref BucketName
S3Key: !Sub ${SkillName}_lambda_package.zip
FunctionName: !Sub bp_alexa_${SkillName}
Handler: main.lambda_handler
Role: !GetAtt LambdaExecutionRole.Arn
Runtime: python3.7
这是堆栈事件历史记录:
2019-09-24 17:21:53 UTC-0400 bp-alexa-play-fortnite-stack ROLLBACK_COMPLETE - AWS::CloudFormation::Stack
2019-09-24 17:21:52 UTC-0400 LambdaExecutionRole DELETE_COMPLETE - AWS::IAM::Role
2019-09-24 17:21:50 UTC-0400 LambdaExecutionRole DELETE_IN_PROGRESS - AWS::IAM::Role
2019-09-24 17:21:50 UTC-0400 AlexaS3ReadRole DELETE_COMPLETE - AWS::IAM::Role
2019-09-24 17:21:49 UTC-0400 LambdaFunction DELETE_COMPLETE - AWS::Lambda::Function
2019-09-24 17:21:49 UTC-0400 LambdaFunction DELETE_IN_PROGRESS - AWS::Lambda::Function
2019-09-24 17:21:49 UTC-0400 AlexaS3ReadRole DELETE_IN_PROGRESS - AWS::IAM::Role
2019-09-24 17:21:48 UTC-0400 AlexaSkill DELETE_COMPLETE - Alexa::ASK::Skill
2019-09-24 17:21:46 UTC-0400 AlexaSkill DELETE_IN_PROGRESS - Alexa::ASK::Skill
2019-09-24 17:21:45 UTC-0400 bp-alexa-play-fortnite-stack ROLLBACK_IN_PROGRESS The following resource(s) failed to create: [AlexaSkill]. . Rollback requested by user. AWS::CloudFormation::Stack
2019-09-24 17:21:44 UTC-0400 AlexaSkill CREATE_FAILED Error occurred while updating the skill. Cause: Resource not found. Alexa::ASK::Skill
2019-09-24 17:21:32 UTC-0400 AlexaSkill CREATE_IN_PROGRESS Resource creation Initiated Alexa::ASK::Skill
2019-09-24 17:21:29 UTC-0400 AlexaSkill CREATE_IN_PROGRESS - Alexa::ASK::Skill
2019-09-24 17:21:27 UTC-0400 LambdaFunction CREATE_COMPLETE - AWS::Lambda::Function
2019-09-24 17:21:27 UTC-0400 LambdaFunction CREATE_IN_PROGRESS Resource creation Initiated AWS::Lambda::Function
2019-09-24 17:21:26 UTC-0400 LambdaFunction CREATE_IN_PROGRESS - AWS::Lambda::Function
2019-09-24 17:21:23 UTC-0400 LambdaExecutionRole CREATE_COMPLETE - AWS::IAM::Role
2019-09-24 17:21:23 UTC-0400 AlexaS3ReadRole CREATE_COMPLETE - AWS::IAM::Role
2019-09-24 17:20:13 UTC-0400 LambdaExecutionRole CREATE_IN_PROGRESS Resource creation Initiated AWS::IAM::Role
2019-09-24 17:20:12 UTC-0400 LambdaExecutionRole CREATE_IN_PROGRESS - AWS::IAM::Role
2019-09-24 17:20:12 UTC-0400 AlexaS3ReadRole CREATE_IN_PROGRESS Resource creation Initiated AWS::IAM::Role
2019-09-24 17:20:11 UTC-0400 AlexaS3ReadRole CREATE_IN_PROGRESS - AWS::IAM::Role
2019-09-24 17:20:08 UTC-0400 bp-alexa-play-fortnite-stack CREATE_IN_PROGRESS User Initiated AWS::CloudFormation::Stack
[您极有可能试图在资源不可用的区域中部署堆栈。如果可能的话,请先尝试将其部署在弗吉尼亚州。