NIr*_*odi 9 amazon-web-services aws-cloudformation
在AWS云形成中,我面临以下验证错误:
Model validation failed (#/EventSourceArn: failed validation constraint for keyword [pattern])
Run Code Online (Sandbox Code Playgroud)
canary.yaml
Canary:
Type: AWS::Synthetics::Canary
Properties:
Name:
Fn::Sub: test12345678901234567889-development
Code:
Handler: exports.handler
Script: |
const https = require('https')
const URL = process.env.URL;
var synthetics = require('Synthetics');
const log = require('SyntheticsLogger');
log.info('URL:'+URL);
exports.handler = async function(event) {
const promise = new Promise(function(resolve, reject) {
https.get(URL, (res) => {
resolve(res.statusCode)
}).on('error', (e) => {
reject(Error(e))
})
})
return promise
}
ExecutionRoleArn:
Fn::GetAtt:
- CloudWatchSyntheticsRole
- Arn
RuntimeVersion: syn-nodejs-puppeteer-3.2
RunConfig:
TimeoutInSeconds: 60
EnvironmentVariables:
URL : !Sub "http://{{resolve:ssm:/${Portfolio}/${ApplicationEnvironmentTag}/common/ApplicationLoadBalancerUrl}}/management/health"
ArtifactS3Location:
Fn::Join:
- ''
- - s3://
- Ref: ResultsBucket
StartCanaryAfterCreation: True
Schedule:
Expression: rate(1 minute) # every minute
DurationInSeconds: 0 # run indefinitely
SuccessRetentionPeriod: 90
FailureRetentionPeriod: 180
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
24156 次 |
| 最近记录: |