{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/Name",
  "/properties/Regions",
  "/properties/KmsKeyId"
 ],
 "definitions": {
  "AssertionDefinition": {
   "additionalProperties": false,
   "properties": {
    "Text": {
     "maxLength": 1000,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "Text"
   ],
   "type": "object"
  },
  "AssociatedSystem": {
   "additionalProperties": false,
   "properties": {
    "SystemArn": {
     "pattern": "^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}$",
     "type": "string"
    },
    "UserJourneyIds": {
     "insertionOrder": false,
     "items": {
      "pattern": "^\\S{1,255}$",
      "type": "string"
     },
     "maxItems": 50,
     "type": "array"
    }
   },
   "required": [
    "SystemArn"
   ],
   "type": "object"
  },
  "CrossAccountRoleConfiguration": {
   "additionalProperties": false,
   "properties": {
    "CrossAccountRoleArn": {
     "maxLength": 2048,
     "minLength": 20,
     "pattern": "^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):iam::[0-9]{12}:role\\/(([^\\/][\\x21-\\x7E]+\\/){1,511})?[A-Za-z0-9_+=,.@-]{1,64}$",
     "type": "string"
    },
    "ExternalId": {
     "type": "string"
    }
   },
   "required": [
    "CrossAccountRoleArn"
   ],
   "type": "object"
  },
  "DisasterRecoverySource": {
   "additionalProperties": false,
   "properties": {
    "PolicyName": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "EffectivePolicyValues": {
   "additionalProperties": false,
   "properties": {
    "AvailabilitySlo": {
     "$ref": "#/definitions/SloSource"
    },
    "MultiAzDrApproach": {
     "$ref": "#/definitions/DisasterRecoverySource"
    },
    "MultiAzRpo": {
     "$ref": "#/definitions/TargetSource"
    },
    "MultiAzRto": {
     "$ref": "#/definitions/TargetSource"
    },
    "MultiRegionDrApproach": {
     "$ref": "#/definitions/DisasterRecoverySource"
    },
    "MultiRegionRpo": {
     "$ref": "#/definitions/TargetSource"
    },
    "MultiRegionRto": {
     "$ref": "#/definitions/TargetSource"
    }
   },
   "type": "object"
  },
  "EksSource": {
   "additionalProperties": false,
   "properties": {
    "ClusterArn": {
     "pattern": "^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}$",
     "type": "string"
    },
    "Namespaces": {
     "insertionOrder": false,
     "items": {
      "type": "string"
     },
     "maxItems": 10,
     "minItems": 1,
     "type": "array"
    }
   },
   "required": [
    "ClusterArn",
    "Namespaces"
   ],
   "type": "object"
  },
  "InputSourceDefinition": {
   "additionalProperties": false,
   "properties": {
    "ResourceConfiguration": {
     "$ref": "#/definitions/ResourceConfiguration"
    }
   },
   "required": [
    "ResourceConfiguration"
   ],
   "type": "object"
  },
  "PermissionModel": {
   "additionalProperties": false,
   "properties": {
    "CrossAccountRoleArns": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/CrossAccountRoleConfiguration"
     },
     "maxItems": 10,
     "type": "array"
    },
    "InvokerRoleName": {
     "pattern": "^[A-Za-z0-9_+=,.@\\-]{1,64}$",
     "type": "string"
    }
   },
   "required": [
    "InvokerRoleName"
   ],
   "type": "object"
  },
  "ReportOutputConfiguration": {
   "additionalProperties": false,
   "oneOf": [
    {
     "required": [
      "S3"
     ]
    }
   ],
   "properties": {
    "S3": {
     "$ref": "#/definitions/S3ReportOutputConfiguration"
    }
   },
   "type": "object"
  },
  "ResourceConfiguration": {
   "additionalProperties": false,
   "oneOf": [
    {
     "required": [
      "ResourceTags"
     ]
    },
    {
     "required": [
      "CfnStackArn"
     ]
    },
    {
     "required": [
      "TfStateFileUrl"
     ]
    },
    {
     "required": [
      "Eks"
     ]
    },
    {
     "required": [
      "DesignFileS3Url"
     ]
    }
   ],
   "properties": {
    "CfnStackArn": {
     "pattern": "^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}$",
     "type": "string"
    },
    "DesignFileS3Url": {
     "type": "string"
    },
    "Eks": {
     "$ref": "#/definitions/EksSource"
    },
    "ResourceTags": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/ResourceTag"
     },
     "maxItems": 10,
     "minItems": 1,
     "type": "array"
    },
    "TfStateFileUrl": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "ResourceTag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Values": {
     "insertionOrder": false,
     "items": {
      "type": "string"
     },
     "maxItems": 10,
     "minItems": 0,
     "type": "array"
    }
   },
   "required": [
    "Key",
    "Values"
   ],
   "type": "object"
  },
  "S3ReportOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "BucketOwner": {
     "pattern": "^\\d{12}$",
     "type": "string"
    },
    "BucketPath": {
     "maxLength": 512,
     "minLength": 3,
     "pattern": "^(s3://)?[a-z0-9][a-z0-9.-]{1,61}[a-z0-9](/.*)?$",
     "type": "string"
    }
   },
   "required": [
    "BucketPath",
    "BucketOwner"
   ],
   "type": "object"
  },
  "ServiceReportConfiguration": {
   "additionalProperties": false,
   "properties": {
    "ReportOutput": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/ReportOutputConfiguration"
     },
     "maxItems": 1,
     "minItems": 1,
     "type": "array"
    }
   },
   "required": [
    "ReportOutput"
   ],
   "type": "object"
  },
  "SloSource": {
   "additionalProperties": false,
   "properties": {
    "PolicyName": {
     "type": "string"
    },
    "Value": {
     "type": "number"
    }
   },
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "Value": {
     "maxLength": 256,
     "minLength": 0,
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  },
  "TargetSource": {
   "additionalProperties": false,
   "properties": {
    "PolicyName": {
     "type": "string"
    },
    "Value": {
     "type": "integer"
    }
   },
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/ServiceArn"
 ],
 "properties": {
  "Assertions": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/AssertionDefinition"
   },
   "maxItems": 20,
   "type": "array"
  },
  "AssociatedSystems": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/AssociatedSystem"
   },
   "maxItems": 1000,
   "type": "array"
  },
  "CreatedAt": {
   "format": "date-time",
   "type": "string"
  },
  "DependencyDiscovery": {
   "enum": [
    "ENABLED",
    "DISABLED",
    "INITIALIZING"
   ],
   "type": "string"
  },
  "Description": {
   "maxLength": 615,
   "type": "string"
  },
  "EffectivePolicyValues": {
   "$ref": "#/definitions/EffectivePolicyValues"
  },
  "InputSources": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/InputSourceDefinition"
   },
   "maxItems": 20,
   "type": "array"
  },
  "KmsKeyId": {
   "maxLength": 2048,
   "minLength": 1,
   "pattern": "^((arn:aws(-[^:]+)?:kms:[a-zA-Z0-9-]*:[0-9]{12}:((key/[a-zA-Z0-9-]{36})|(alias/[a-zA-Z0-9-_/]+)))|([a-zA-Z0-9-]{36})|(alias/[a-zA-Z0-9-_/]+))$",
   "type": "string"
  },
  "Name": {
   "pattern": "^[A-Za-z0-9][A-Za-z0-9_\\-]{1,59}$",
   "type": "string"
  },
  "PermissionModel": {
   "$ref": "#/definitions/PermissionModel"
  },
  "PolicyArn": {
   "pattern": "^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}$",
   "type": "string"
  },
  "Regions": {
   "insertionOrder": false,
   "items": {
    "minLength": 6,
    "pattern": "^[a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]$",
    "type": "string"
   },
   "maxItems": 10,
   "minItems": 1,
   "type": "array"
  },
  "ReportConfiguration": {
   "$ref": "#/definitions/ServiceReportConfiguration"
  },
  "ServiceArn": {
   "pattern": "^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}$",
   "type": "string"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "maxItems": 50,
   "type": "array",
   "uniqueItems": true
  },
  "UpdatedAt": {
   "format": "date-time",
   "type": "string"
  }
 },
 "readOnlyProperties": [
  "/properties/ServiceArn",
  "/properties/CreatedAt",
  "/properties/UpdatedAt",
  "/properties/EffectivePolicyValues"
 ],
 "required": [
  "Name",
  "Regions"
 ],
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::ResilienceHubV2::Service",
 "writeOnlyProperties": [
  "/properties/KmsKeyId"
 ]
}
