I am getting the below error when I tried to create aws synthetics canary I am using a cloudformation template and the template succeeds if I don't include the AWS::Synthetics::Canary section, so I believe something wrong when executing the canary section.
Resource handler returned message: "Model validation failed (#/Code: #: only 1 subschema matches out of 2) #/Code: #: 0 subschemas matched instead of one (#/Code)" (RequestToken: 42ff0d18-263e-8503-618e-e0d3d76e3bd8, HandlerErrorCode: InvalidRequest)
Below is the section
TreasuryCanary:
Type: AWS::Synthetics::Canary
Properties:
Name: !Ref CanaryName
ExecutionRoleArn: !Sub arn:aws:iam::${AWS::AccountId}:role/${CloudWatchSyntheticsRole}
Code:
Handler: app.canary_handler
# S3Bucket: !Sub ${S3BucketForCanaryCode}
S3Bucket: !Ref S3BucketForCanaryCode
# ArtifactS3Location: !Sub s3://${ArtifactBucketForCanary}
ArtifactS3Location:
Fn::Join:
- ''
- - s3://
- Ref: S3BucketARNForCanary
RuntimeVersion: syn-python-selenium-1.3
Schedule:
Expression: rate(5 minutes)
StartCanaryAfterCreation: false
I also tried to have ExecutionRoleArn as below but still no luck.
ExecutionRoleArn: 'arn:aws:iam::${AWS::AccountId}:role/CloudWatchSyntheticsRole'
Any help is much appreciated.