我正在使用 CloudFormation 創建一個 AWS CloudWatch 儀表板,并試圖在 DashboardBody 中使用 Fn::FindInMap。然而,該值沒有被成功替換。誰能幫幫我?
下面是我的代碼:Mappings:
EnvSource。
Dev:
"SMSFailed": sns/us-east-1/XXX/directPublishToPhoneNumber/Failure
Resources:
MonitoringDashboard:
型別。"AWS::CloudWatch::Dashboard"
屬性。
儀表板名稱。
監視-測驗-儀表板
DashboardBody:
!"Sub"{"widgets":[{"height":6, "width":12, "y":1, "x":12, "type": "log", "properties":{"query": "SOURCE 'Fn::FindInMap' : [ 'ABC', 'DomainParameters', 'DomainName'] | fields @timestamp, @message, delivery. providerResponse, status| filter @message like //|stats count(status) as ErrorCount by delivery.providerResponse| sort @timestamp asc", "region": "us-east-1", "title": "SMS Failed", "view": "table"}}"
uj5u.com熱心網友回復:
你可以使用串列形式的Sub:
Resources:
MonitoringDashboard。
型別。"AWS::CloudWatch::Dashboard"
屬性。
儀表板名稱。
監視-測驗-儀表板
DashboardBody:
!Sub
- "{"widgets":[{"height":6,"width":12,"y":1,"x":12,"type":"log","properties":{"query":"SOURCE ${FindInMap} | fields @timestamp, @message, delivery.providerResponse, status
| filter @message like //
|stats count(status) as ErrorCount by delivery.providerResponse
| sort @timestamp asc", "region": "us-east-1", "title": "SMS Failed", "view": "table"}}"
- 域名。!FindInMap [ 'ABC', 'DomainParameters', 'DomainName']
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/325338.html
標籤:

