问题描述
我想根据 CloudFormation 中的条件创建 AWS 资源。条件取决于参数值,因此如果参数值为空,则不创建 AWS 资源。如果我为参数提供值,则应仅创建 AWS 资源。参数值来自如下变量。
我可以在条件部分使用 AWS::Novalue 以便在 S3_NAME 为空时不创建 aws 资源吗?或者不知道我应该如何处理这个。
Conditions:
CreateS3Alerts:
Fn::Not
- ${self:custom.config.S3_NAME}
- AWS::Novalue
S35xxErrors:
Type: AWS::CloudWatch::Alarm
Condition: CreateS3Alerts
Properties:
AlarmName: "S3 5XX Errors"