gpt4 book ai didi

amazon-web-services - cloudformation 堆栈中的内部转换错误

转载 作者:行者123 更新时间:2023-12-03 07:44:42 26 4
gpt4 key购买 nike

部署此模板时出现“内部转换”错误。我使用映射来转换开发和生产设置。这适用于单个值,但 cloudformation 在尝试转换事件配置时感到窒息。这通过了aws cloudformation validate-template我的配置有什么问题吗?:

我使用映射来转换开发和生产设置。这适用于单个值,但 SAM 在尝试转换事件配置时感到窒息,我的配置出了什么问题?:

AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'

Parameters:
env:
Description: Config map for transforming template with dev or prod values
Type: String
Default: dev

# Template uses !FindInMap along with env parameter to reference dev or prod values defined here
Mappings:
ConfigMap:
dev:
awsAccount: 'dev'
configFile: 'dev_config.yaml'
cloudwatchEvents: !Ref "AWS::NoValue"
prod:
awsAccount: 'prod'
configFile: 'prod_config.yaml'
cloudwatchEvents:
Schedule1:
Type: Schedule
Properties:
Schedule: rate(3 minutes)

Resources:
myfunction:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: ../build
Handler: lambda_function.lambda_handler
Runtime: python3.6
MemorySize: 128
Timeout: 30
Events:
!FindInMap
- ConfigMap
- !Ref env
- cloudwatchEvents

Environment:
Variables:
config_file: !FindInMap
- ConfigMap
- !Ref env
- configFile

Tags:
account: !FindInMap
- ConfigMap
- !Ref env
- awsAccount
blah: derp

最佳答案

看起来您在 !FindInMap 之后有一个拼写错误,之后缺少一个冒号。应该是!FindInMap:

关于amazon-web-services - cloudformation 堆栈中的内部转换错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53399010/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com