{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/Configuration/Standard/NetworkInterfaceArn",
  "/properties/AvailabilityZone",
  "/properties/RegionName"
 ],
 "definitions": {
  "AutomaticEncryptionKeyConfiguration": {
   "additionalProperties": false,
   "type": "object"
  },
  "Day": {
   "enum": [
    "MONDAY",
    "TUESDAY",
    "WEDNESDAY",
    "THURSDAY",
    "FRIDAY",
    "SATURDAY",
    "SUNDAY"
   ],
   "type": "string"
  },
  "DefaultMaintenanceConfiguration": {
   "additionalProperties": false,
   "type": "object"
  },
  "FlowTransitEncryption": {
   "additionalProperties": false,
   "properties": {
    "EncryptionKeyConfiguration": {
     "$ref": "#/definitions/FlowTransitEncryptionKeyConfiguration"
    },
    "EncryptionKeyType": {
     "$ref": "#/definitions/FlowTransitEncryptionKeyType"
    }
   },
   "required": [
    "EncryptionKeyConfiguration"
   ],
   "type": "object"
  },
  "FlowTransitEncryptionKeyConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "SecretsManager": {
       "$ref": "#/definitions/SecretsManagerEncryptionKeyConfiguration"
      }
     },
     "required": [
      "SecretsManager"
     ],
     "title": "SecretsManager",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Automatic": {
       "$ref": "#/definitions/AutomaticEncryptionKeyConfiguration"
      }
     },
     "required": [
      "Automatic"
     ],
     "title": "Automatic",
     "type": "object"
    }
   ]
  },
  "FlowTransitEncryptionKeyType": {
   "enum": [
    "SECRETS_MANAGER",
    "AUTOMATIC"
   ],
   "type": "string"
  },
  "ForwardErrorCorrectionState": {
   "enum": [
    "ENABLED",
    "DISABLED"
   ],
   "type": "string"
  },
  "MaintenanceConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "PreferredDayTime": {
       "$ref": "#/definitions/PreferredDayTimeMaintenanceConfiguration"
      }
     },
     "required": [
      "PreferredDayTime"
     ],
     "title": "PreferredDayTime",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Default": {
       "$ref": "#/definitions/DefaultMaintenanceConfiguration"
      }
     },
     "required": [
      "Default"
     ],
     "title": "Default",
     "type": "object"
    }
   ]
  },
  "MaintenanceType": {
   "enum": [
    "PREFERRED_DAY_TIME",
    "DEFAULT"
   ],
   "type": "string"
  },
  "MediaConnectFlowRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "DestinationTransitEncryption": {
     "$ref": "#/definitions/FlowTransitEncryption"
    },
    "FlowArn": {
     "pattern": "^arn:(aws[a-zA-Z-]*):mediaconnect:[a-z0-9-]+:[0-9]{12}:flow:[a-zA-Z0-9-]+:[a-zA-Z0-9_-]+$",
     "type": "string"
    },
    "FlowSourceArn": {
     "pattern": "^arn:(aws[a-zA-Z-]*):mediaconnect:[a-z0-9-]+:[0-9]{12}:source:[a-zA-Z0-9-]+:[a-zA-Z0-9_-]+$",
     "type": "string"
    }
   },
   "required": [
    "DestinationTransitEncryption"
   ],
   "type": "object"
  },
  "MediaLiveInputPipelineId": {
   "enum": [
    "PIPELINE_0",
    "PIPELINE_1"
   ],
   "type": "string"
  },
  "MediaLiveInputRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "DestinationTransitEncryption": {
     "$ref": "#/definitions/MediaLiveTransitEncryption"
    },
    "MediaLiveInputArn": {
     "pattern": "^arn:(aws[a-zA-Z-]*):medialive:[a-z0-9-]+:[0-9]{12}:input:[a-zA-Z0-9]+$",
     "type": "string"
    },
    "MediaLivePipelineId": {
     "$ref": "#/definitions/MediaLiveInputPipelineId"
    }
   },
   "required": [
    "DestinationTransitEncryption"
   ],
   "type": "object"
  },
  "MediaLiveTransitEncryption": {
   "additionalProperties": false,
   "properties": {
    "EncryptionKeyConfiguration": {
     "$ref": "#/definitions/MediaLiveTransitEncryptionKeyConfiguration"
    },
    "EncryptionKeyType": {
     "$ref": "#/definitions/MediaLiveTransitEncryptionKeyType"
    }
   },
   "required": [
    "EncryptionKeyConfiguration"
   ],
   "type": "object"
  },
  "MediaLiveTransitEncryptionKeyConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "SecretsManager": {
       "$ref": "#/definitions/SecretsManagerEncryptionKeyConfiguration"
      }
     },
     "required": [
      "SecretsManager"
     ],
     "title": "SecretsManager",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Automatic": {
       "$ref": "#/definitions/AutomaticEncryptionKeyConfiguration"
      }
     },
     "required": [
      "Automatic"
     ],
     "title": "Automatic",
     "type": "object"
    }
   ]
  },
  "MediaLiveTransitEncryptionKeyType": {
   "enum": [
    "SECRETS_MANAGER",
    "AUTOMATIC"
   ],
   "type": "string"
  },
  "PreferredDayTimeMaintenanceConfiguration": {
   "additionalProperties": false,
   "properties": {
    "Day": {
     "$ref": "#/definitions/Day"
    },
    "Time": {
     "type": "string"
    }
   },
   "required": [
    "Day",
    "Time"
   ],
   "type": "object"
  },
  "RistRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "DestinationAddress": {
     "type": "string"
    },
    "DestinationPort": {
     "maximum": 65535,
     "minimum": 1024,
     "type": "integer"
    }
   },
   "required": [
    "DestinationAddress",
    "DestinationPort"
   ],
   "type": "object"
  },
  "RouterOutputConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Standard": {
       "$ref": "#/definitions/StandardRouterOutputConfiguration"
      }
     },
     "required": [
      "Standard"
     ],
     "title": "Standard",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "MediaConnectFlow": {
       "$ref": "#/definitions/MediaConnectFlowRouterOutputConfiguration"
      }
     },
     "required": [
      "MediaConnectFlow"
     ],
     "title": "MediaConnectFlow",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "MediaLiveInput": {
       "$ref": "#/definitions/MediaLiveInputRouterOutputConfiguration"
      }
     },
     "required": [
      "MediaLiveInput"
     ],
     "title": "MediaLiveInput",
     "type": "object"
    }
   ]
  },
  "RouterOutputProtocol": {
   "enum": [
    "RTP",
    "RIST",
    "SRT_CALLER",
    "SRT_LISTENER"
   ],
   "type": "string"
  },
  "RouterOutputProtocolConfiguration": {
   "oneOf": [
    {
     "additionalProperties": false,
     "properties": {
      "Rtp": {
       "$ref": "#/definitions/RtpRouterOutputConfiguration"
      }
     },
     "required": [
      "Rtp"
     ],
     "title": "Rtp",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "Rist": {
       "$ref": "#/definitions/RistRouterOutputConfiguration"
      }
     },
     "required": [
      "Rist"
     ],
     "title": "Rist",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "SrtListener": {
       "$ref": "#/definitions/SrtListenerRouterOutputConfiguration"
      }
     },
     "required": [
      "SrtListener"
     ],
     "title": "SrtListener",
     "type": "object"
    },
    {
     "additionalProperties": false,
     "properties": {
      "SrtCaller": {
       "$ref": "#/definitions/SrtCallerRouterOutputConfiguration"
      }
     },
     "required": [
      "SrtCaller"
     ],
     "title": "SrtCaller",
     "type": "object"
    }
   ]
  },
  "RouterOutputRoutedState": {
   "enum": [
    "ROUTED",
    "ROUTING",
    "UNROUTED"
   ],
   "type": "string"
  },
  "RouterOutputState": {
   "enum": [
    "CREATING",
    "STANDBY",
    "STARTING",
    "ACTIVE",
    "STOPPING",
    "DELETING",
    "UPDATING",
    "ERROR",
    "RECOVERING",
    "MIGRATING"
   ],
   "type": "string"
  },
  "RouterOutputTier": {
   "enum": [
    "OUTPUT_100",
    "OUTPUT_50",
    "OUTPUT_20"
   ],
   "type": "string"
  },
  "RouterOutputType": {
   "enum": [
    "STANDARD",
    "MEDIACONNECT_FLOW",
    "MEDIALIVE_INPUT"
   ],
   "type": "string"
  },
  "RoutingScope": {
   "enum": [
    "REGIONAL",
    "GLOBAL"
   ],
   "type": "string"
  },
  "RtpRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "DestinationAddress": {
     "type": "string"
    },
    "DestinationPort": {
     "maximum": 65531,
     "minimum": 1024,
     "type": "integer"
    },
    "ForwardErrorCorrection": {
     "$ref": "#/definitions/ForwardErrorCorrectionState"
    }
   },
   "required": [
    "DestinationAddress",
    "DestinationPort"
   ],
   "type": "object"
  },
  "SecretsManagerEncryptionKeyConfiguration": {
   "additionalProperties": false,
   "properties": {
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "pattern": "^arn:(aws[a-zA-Z-]*):iam::[0-9]{12}:role/[a-zA-Z0-9_+=,.@-]+$",
     "type": "string"
    },
    "SecretArn": {
     "pattern": "^arn:(aws[a-zA-Z-]*):secretsmanager:[a-z0-9-]+:[0-9]{12}:secret:[a-zA-Z0-9/_+=.@-]+$",
     "type": "string"
    }
   },
   "required": [
    "RoleArn",
    "SecretArn"
   ],
   "type": "object"
  },
  "SrtCallerRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "DestinationAddress": {
     "type": "string"
    },
    "DestinationPort": {
     "maximum": 65535,
     "minimum": 1024,
     "type": "integer"
    },
    "EncryptionConfiguration": {
     "$ref": "#/definitions/SrtEncryptionConfiguration"
    },
    "MinimumLatencyMilliseconds": {
     "maximum": 10000,
     "minimum": 10,
     "type": "integer"
    },
    "StreamId": {
     "type": "string"
    }
   },
   "required": [
    "DestinationAddress",
    "DestinationPort",
    "MinimumLatencyMilliseconds"
   ],
   "type": "object"
  },
  "SrtEncryptionConfiguration": {
   "additionalProperties": false,
   "properties": {
    "EncryptionKey": {
     "$ref": "#/definitions/SecretsManagerEncryptionKeyConfiguration"
    }
   },
   "required": [
    "EncryptionKey"
   ],
   "type": "object"
  },
  "SrtListenerRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "EncryptionConfiguration": {
     "$ref": "#/definitions/SrtEncryptionConfiguration"
    },
    "MinimumLatencyMilliseconds": {
     "maximum": 10000,
     "minimum": 10,
     "type": "integer"
    },
    "Port": {
     "maximum": 30000,
     "minimum": 3000,
     "type": "integer"
    }
   },
   "required": [
    "MinimumLatencyMilliseconds",
    "Port"
   ],
   "type": "object"
  },
  "StandardRouterOutputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "NetworkInterfaceArn": {
     "pattern": "^arn:(aws[a-zA-Z-]*):mediaconnect:[a-z0-9-]+:[0-9]{12}:routerNetworkInterface:[a-z0-9]{12}$",
     "type": "string"
    },
    "Protocol": {
     "$ref": "#/definitions/RouterOutputProtocol"
    },
    "ProtocolConfiguration": {
     "$ref": "#/definitions/RouterOutputProtocolConfiguration"
    }
   },
   "required": [
    "NetworkInterfaceArn",
    "ProtocolConfiguration"
   ],
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  },
  "Unit": {
   "additionalProperties": false,
   "type": "object"
  }
 },
 "primaryIdentifier": [
  "/properties/Arn"
 ],
 "properties": {
  "Arn": {
   "pattern": "^arn:(aws[a-zA-Z-]*):mediaconnect:[a-z0-9-]+:[0-9]{12}:routerOutput:[a-z0-9]{12}$",
   "type": "string"
  },
  "AvailabilityZone": {
   "type": "string"
  },
  "Configuration": {
   "$ref": "#/definitions/RouterOutputConfiguration"
  },
  "CreatedAt": {
   "format": "date-time",
   "type": "string"
  },
  "Id": {
   "type": "string"
  },
  "IpAddress": {
   "type": "string"
  },
  "MaintenanceConfiguration": {
   "$ref": "#/definitions/MaintenanceConfiguration"
  },
  "MaintenanceType": {
   "$ref": "#/definitions/MaintenanceType"
  },
  "MaximumBitrate": {
   "type": "integer"
  },
  "Name": {
   "maxLength": 128,
   "minLength": 1,
   "type": "string"
  },
  "OutputType": {
   "$ref": "#/definitions/RouterOutputType"
  },
  "RegionName": {
   "type": "string"
  },
  "RoutedState": {
   "$ref": "#/definitions/RouterOutputRoutedState"
  },
  "RoutingScope": {
   "$ref": "#/definitions/RoutingScope"
  },
  "State": {
   "$ref": "#/definitions/RouterOutputState"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array"
  },
  "Tier": {
   "$ref": "#/definitions/RouterOutputTier"
  },
  "UpdatedAt": {
   "format": "date-time",
   "type": "string"
  }
 },
 "propertyTransform": {
  "/properties/MaintenanceConfiguration/PreferredDayTime/Time": "($groups := $match(Time, /^([0-9]{2}):([0-9]{2})(?::([0-9]{2})(?:\\.[0-9]+)?)?(?:Z|([+\\-][0-9]{2}:[0-9]{2}))?$/).groups;$seconds := $groups[2] ? $groups[2] : \"00\";$timezone := $groups[3] ? $groups[3] : \"+00:00\";$join([$groups[0], \":\", $groups[1], \":\", $seconds, \"Z\"]);)"
 },
 "readOnlyProperties": [
  "/properties/Arn",
  "/properties/CreatedAt",
  "/properties/Id",
  "/properties/IpAddress",
  "/properties/MaintenanceType",
  "/properties/OutputType",
  "/properties/RoutedState",
  "/properties/State",
  "/properties/UpdatedAt"
 ],
 "required": [
  "Configuration",
  "MaximumBitrate",
  "Name",
  "RoutingScope",
  "Tier"
 ],
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::MediaConnect::RouterOutput"
}
