{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/Name"
 ],
 "definitions": {
  "ArtifactConfig": {
   "additionalProperties": false,
   "properties": {
    "S3Encryption": {
     "$ref": "#/definitions/S3Encryption"
    }
   },
   "type": "object"
  },
  "BaseScreenshot": {
   "properties": {
    "IgnoreCoordinates": {
     "items": {
      "type": "string"
     },
     "type": "array"
    },
    "ScreenshotName": {
     "type": "string"
    }
   },
   "required": [
    "ScreenshotName"
   ],
   "type": "object"
  },
  "BrowserConfig": {
   "additionalProperties": false,
   "properties": {
    "BrowserType": {
     "$ref": "#/definitions/BrowserType"
    }
   },
   "required": [
    "BrowserType"
   ],
   "type": "object"
  },
  "BrowserType": {
   "enum": [
    "CHROME",
    "FIREFOX"
   ],
   "type": "string"
  },
  "Code": {
   "additionalProperties": false,
   "oneOf": [
    {
     "required": [
      "Handler",
      "S3Bucket",
      "S3Key"
     ]
    },
    {
     "required": [
      "BlueprintTypes",
      "S3Bucket",
      "S3Key"
     ]
    },
    {
     "required": [
      "Handler",
      "Script"
     ]
    },
    {
     "required": [
      "BlueprintTypes",
      "Script"
     ]
    }
   ],
   "properties": {
    "BlueprintTypes": {
     "items": {
      "maxLength": 128,
      "minLength": 1,
      "pattern": "^[0-9a-zA-Z_\\-\\.]+$",
      "type": "string"
     },
     "maxItems": 1,
     "minItems": 0,
     "type": "array"
    },
    "Dependencies": {
     "items": {
      "$ref": "#/definitions/Dependency"
     },
     "maxItems": 1,
     "minItems": 0,
     "type": "array"
    },
    "Handler": {
     "maxLength": 128,
     "minLength": 0,
     "pattern": "^(([0-9a-zA-Z_-]+(\\/|\\.))*[0-9A-Za-z_\\\\-]+(\\.|::)[A-Za-z_][A-Za-z0-9_]*)?$",
     "type": "string"
    },
    "S3Bucket": {
     "format": "AWS::S3::Bucket.Name",
     "maxLength": 1024,
     "minLength": 1,
     "type": "string"
    },
    "S3Key": {
     "maxLength": 1024,
     "minLength": 1,
     "type": "string"
    },
    "S3ObjectVersion": {
     "type": "string"
    },
    "Script": {
     "type": "string"
    },
    "SourceLocationArn": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "Dependency": {
   "additionalProperties": false,
   "properties": {
    "Reference": {
     "maxLength": 140,
     "minLength": 1,
     "pattern": "arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+",
     "type": "string"
    },
    "Type": {
     "enum": [
      "LambdaLayer"
     ],
     "type": "string"
    }
   },
   "required": [
    "Reference"
   ],
   "type": "object"
  },
  "ResourceToTag": {
   "enum": [
    "lambda-function"
   ],
   "type": "string"
  },
  "RetryConfig": {
   "additionalProperties": false,
   "properties": {
    "MaxRetries": {
     "maximum": 2,
     "minimum": 0,
     "type": "integer"
    }
   },
   "required": [
    "MaxRetries"
   ],
   "type": "object"
  },
  "RunConfig": {
   "additionalProperties": false,
   "properties": {
    "ActiveTracing": {
     "type": "boolean"
    },
    "EnvironmentVariables": {
     "additionalProperties": false,
     "patternProperties": {
      "[a-zA-Z][a-zA-Z0-9_]+": {
       "type": "string"
      }
     },
     "type": "object"
    },
    "EphemeralStorage": {
     "maximum": 10240,
     "minimum": 1024,
     "type": "integer"
    },
    "MemoryInMB": {
     "maximum": 3008,
     "minimum": 960,
     "type": "integer"
    },
    "TimeoutInSeconds": {
     "maximum": 840,
     "minimum": 3,
     "type": "integer"
    }
   },
   "type": "object"
  },
  "S3Encryption": {
   "additionalProperties": false,
   "properties": {
    "EncryptionMode": {
     "enum": [
      "SSE_KMS",
      "SSE_S3"
     ],
     "type": "string"
    },
    "KmsKeyArn": {
     "format": "AWS::KMS::Key.Arn",
     "maxLength": 2048,
     "minLength": 1,
     "pattern": "^arn:(aws[a-zA-Z-]*)?:kms:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:key/[\\w\\-\\/]+$",
     "type": "string"
    }
   },
   "type": "object"
  },
  "Schedule": {
   "additionalProperties": false,
   "properties": {
    "DurationInSeconds": {
     "maximum": 31622400,
     "minimum": 0,
     "type": "string"
    },
    "Expression": {
     "maxLength": 1024,
     "minLength": 1,
     "type": "string"
    },
    "RetryConfig": {
     "$ref": "#/definitions/RetryConfig"
    }
   },
   "required": [
    "Expression"
   ],
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "type": "string"
    }
   },
   "required": [
    "Value",
    "Key"
   ],
   "type": "object"
  },
  "VPCConfig": {
   "additionalProperties": false,
   "properties": {
    "Ipv6AllowedForDualStack": {
     "type": "boolean"
    },
    "SecurityGroupIds": {
     "format": "AWS::EC2::SecurityGroup.Ids",
     "items": {
      "format": "AWS::EC2::SecurityGroup.Id",
      "type": "string"
     },
     "maxItems": 5,
     "minItems": 0,
     "type": "array"
    },
    "SubnetIds": {
     "items": {
      "type": "string"
     },
     "maxItems": 16,
     "minItems": 0,
     "type": "array"
    },
    "VpcId": {
     "format": "AWS::EC2::VPC.Id",
     "type": "string"
    }
   },
   "required": [
    "SubnetIds",
    "SecurityGroupIds"
   ],
   "type": "object"
  },
  "VisualReference": {
   "additionalProperties": false,
   "properties": {
    "BaseCanaryRunId": {
     "type": "string"
    },
    "BaseScreenshots": {
     "items": {
      "$ref": "#/definitions/BaseScreenshot"
     },
     "type": "array"
    },
    "BrowserType": {
     "$ref": "#/definitions/BrowserType"
    }
   },
   "required": [
    "BaseCanaryRunId"
   ],
   "type": "object"
  }
 },
 "deprecatedProperties": [
  "/properties/DeleteLambdaResourcesOnCanaryDeletion",
  "/properties/VisualReference"
 ],
 "primaryIdentifier": [
  "/properties/Name"
 ],
 "properties": {
  "ArtifactConfig": {
   "$ref": "#/definitions/ArtifactConfig"
  },
  "ArtifactS3Location": {
   "maxLength": 1024,
   "minLength": 1,
   "pattern": "^(s3|S3)://",
   "type": "string"
  },
  "BrowserConfigs": {
   "items": {
    "$ref": "#/definitions/BrowserConfig"
   },
   "maxItems": 2,
   "minItems": 1,
   "type": "array"
  },
  "Code": {
   "$ref": "#/definitions/Code"
  },
  "DeleteLambdaResourcesOnCanaryDeletion": {
   "type": "boolean"
  },
  "DryRunAndUpdate": {
   "type": "boolean"
  },
  "ExecutionRoleArn": {
   "format": "AWS::IAM::Role.Arn",
   "maxLength": 2048,
   "minLength": 1,
   "pattern": "^arn:(aws[a-zA-Z-]*)?:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+$",
   "type": "string"
  },
  "FailureRetentionPeriod": {
   "type": "integer"
  },
  "Id": {
   "type": "string"
  },
  "Name": {
   "pattern": "^[0-9a-z_\\-]{1,255}$",
   "type": "string"
  },
  "ProvisionedResourceCleanup": {
   "enum": [
    "AUTOMATIC",
    "OFF"
   ],
   "type": "string"
  },
  "ResourcesToReplicateTags": {
   "items": {
    "$ref": "#/definitions/ResourceToTag"
   },
   "maxItems": 1,
   "minItems": 1,
   "type": "array",
   "uniqueItems": true
  },
  "RunConfig": {
   "$ref": "#/definitions/RunConfig"
  },
  "RuntimeVersion": {
   "maxLength": 1024,
   "minLength": 1,
   "type": "string"
  },
  "Schedule": {
   "$ref": "#/definitions/Schedule"
  },
  "StartCanaryAfterCreation": {
   "type": "boolean"
  },
  "State": {
   "type": "string"
  },
  "SuccessRetentionPeriod": {
   "type": "integer"
  },
  "Tags": {
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array",
   "uniqueItems": false
  },
  "VPCConfig": {
   "$ref": "#/definitions/VPCConfig"
  },
  "VisualReference": {
   "$ref": "#/definitions/VisualReference"
  },
  "VisualReferences": {
   "items": {
    "$ref": "#/definitions/VisualReference"
   },
   "maxItems": 2,
   "minItems": 1,
   "type": "array"
  }
 },
 "readOnlyProperties": [
  "/properties/Id",
  "/properties/State",
  "/properties/Code/SourceLocationArn"
 ],
 "required": [
  "Name",
  "Code",
  "ArtifactS3Location",
  "ExecutionRoleArn",
  "Schedule",
  "RuntimeVersion"
 ],
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-synthetics",
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::Synthetics::Canary",
 "writeOnlyProperties": [
  "/properties/Code/S3Bucket",
  "/properties/Code/S3Key",
  "/properties/Code/S3ObjectVersion",
  "/properties/Code/Script",
  "/properties/DeleteLambdaResourcesOnCanaryDeletion",
  "/properties/StartCanaryAfterCreation",
  "/properties/ResourcesToReplicateTags",
  "/properties/RunConfig/EnvironmentVariables",
  "/properties/VisualReference",
  "/properties/VisualReferences",
  "/properties/DryRunAndUpdate"
 ]
}
