Amazon web services Fn::ImportValue未在自定义资源中工作
问题:我遇到了一个奇怪的问题,自定义资源中的Amazon web services Fn::ImportValue未在自定义资源中工作,amazon-web-services,amazon-cloudformation,Amazon Web Services,Amazon Cloudformation,问题:我遇到了一个奇怪的问题,自定义资源中的cloudformation固有功能。当我使用时!导入值我的模板成功通过并部署,但如果切换到使用Fn::导入值我会收到以下错误消息: Template format error: YAML not well-formed. 为了完整性,这是有问题的资源: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Custom Ressources
cloudformation
固有功能。当我使用时!导入值
我的模板成功通过并部署,但如果切换到使用Fn::导入值
我会收到以下错误消息:
Template format error: YAML not well-formed.
为了完整性,这是有问题的资源:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Custom Ressources #
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
LambdaEmptyArtifactBucket:
DependsOn:
- ArtifactsBucket
Type: AWS::CloudFormation::CustomResource
Properties:
ServiceToken: !ImportValue util-s3-object-remover-lambda:us-east-1:Lambda:Arn ### <<<--- WORKS
# ServiceToken: Fn::ImportValue: util-s3-object-remover-lambda:us-east-1:Lambda:Arn ### <<<--- DOES NOT WORKS
BucketName: !Ref ArtifactsBucket
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#定制资源#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
lambdamptyartifactbucket:
德彭森:
-人造袋鼠
类型:AWS::CloudFormation::CustomResource
特性:
ServiceToken:!ImportValue util-s3-object-remover-lambda:us-east-1:lambda:Arn###您的Fn::ImportValue:
应该在新行或{}
中:
Properties:
ServiceToken:
Fn::ImportValue: util-s3-object-remover-lambda:us-east-1:Lambda:Arn
BucketName: !Ref ArtifactsBucket
或
Properties:
ServiceToken: {Fn::ImportValue: util-s3-object-remover-lambda:us-east-1:Lambda:Arn}
BucketName: !Ref ArtifactsBucket