{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/Name",
  "/properties/AvailabilityZone",
  "/properties/Source/Name"
 ],
 "definitions": {
  "AudioMonitoringSetting": {
   "additionalProperties": false,
   "properties": {
    "SilentAudio": {
     "$ref": "#/definitions/SilentAudio"
    }
   },
   "type": "object"
  },
  "AutomaticEncryptionKeyConfiguration": {
   "additionalProperties": false,
   "type": "object"
  },
  "BlackFrames": {
   "additionalProperties": false,
   "properties": {
    "State": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    },
    "ThresholdSeconds": {
     "type": "integer"
    }
   },
   "type": "object"
  },
  "Encryption": {
   "additionalProperties": false,
   "properties": {
    "Algorithm": {
     "enum": [
      "aes128",
      "aes192",
      "aes256"
     ],
     "type": "string"
    },
    "ConstantInitializationVector": {
     "type": "string"
    },
    "DeviceId": {
     "type": "string"
    },
    "KeyType": {
     "default": "static-key",
     "enum": [
      "speke",
      "static-key",
      "srt-password"
     ],
     "type": "string"
    },
    "Region": {
     "type": "string"
    },
    "ResourceId": {
     "type": "string"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    },
    "SecretArn": {
     "type": "string"
    },
    "Url": {
     "type": "string"
    }
   },
   "required": [
    "RoleArn"
   ],
   "type": "object"
  },
  "FailoverConfig": {
   "additionalProperties": false,
   "properties": {
    "FailoverMode": {
     "enum": [
      "MERGE",
      "FAILOVER"
     ],
     "type": "string"
    },
    "RecoveryWindow": {
     "type": "integer"
    },
    "SourcePriority": {
     "additionalProperties": false,
     "properties": {
      "PrimarySource": {
       "type": "string"
      }
     },
     "required": [
      "PrimarySource"
     ],
     "type": "object"
    },
    "State": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    }
   },
   "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"
  },
  "Fmtp": {
   "additionalProperties": false,
   "properties": {
    "ChannelOrder": {
     "type": "string"
    },
    "Colorimetry": {
     "enum": [
      "BT601",
      "BT709",
      "BT2020",
      "BT2100",
      "ST2065-1",
      "ST2065-3",
      "XYZ"
     ],
     "type": "string"
    },
    "ExactFramerate": {
     "type": "string"
    },
    "Par": {
     "type": "string"
    },
    "Range": {
     "enum": [
      "NARROW",
      "FULL",
      "FULLPROTECT"
     ],
     "type": "string"
    },
    "ScanMode": {
     "enum": [
      "progressive",
      "interlace",
      "progressive-segmented-frame"
     ],
     "type": "string"
    },
    "Tcs": {
     "enum": [
      "SDR",
      "PQ",
      "HLG",
      "LINEAR",
      "BT2100LINPQ",
      "BT2100LINHLG",
      "ST2065-1",
      "ST428-1",
      "DENSITY"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "FrozenFrames": {
   "additionalProperties": false,
   "properties": {
    "State": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    },
    "ThresholdSeconds": {
     "type": "integer"
    }
   },
   "type": "object"
  },
  "GatewayBridgeSource": {
   "additionalProperties": false,
   "properties": {
    "BridgeArn": {
     "pattern": "arn:.+:mediaconnect.+:bridge:.+",
     "type": "string"
    },
    "VpcInterfaceAttachment": {
     "$ref": "#/definitions/VpcInterfaceAttachment"
    }
   },
   "required": [
    "BridgeArn"
   ],
   "type": "object"
  },
  "InputConfiguration": {
   "additionalProperties": false,
   "properties": {
    "InputPort": {
     "type": "integer"
    },
    "Interface": {
     "$ref": "#/definitions/Interface"
    }
   },
   "required": [
    "InputPort",
    "Interface"
   ],
   "type": "object"
  },
  "Interface": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "type": "string"
    }
   },
   "required": [
    "Name"
   ],
   "type": "object"
  },
  "Maintenance": {
   "additionalProperties": false,
   "properties": {
    "MaintenanceDay": {
     "enum": [
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday",
      "Saturday",
      "Sunday"
     ],
     "type": "string"
    },
    "MaintenanceStartHour": {
     "type": "string"
    }
   },
   "required": [
    "MaintenanceDay",
    "MaintenanceStartHour"
   ],
   "type": "object"
  },
  "MediaStream": {
   "additionalProperties": false,
   "properties": {
    "Attributes": {
     "$ref": "#/definitions/MediaStreamAttributes"
    },
    "ClockRate": {
     "type": "integer"
    },
    "Description": {
     "type": "string"
    },
    "Fmt": {
     "type": "integer"
    },
    "MediaStreamId": {
     "type": "integer"
    },
    "MediaStreamName": {
     "type": "string"
    },
    "MediaStreamType": {
     "enum": [
      "video",
      "audio",
      "ancillary-data"
     ],
     "type": "string"
    },
    "Tags": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/Tag"
     },
     "type": "array"
    },
    "VideoFormat": {
     "enum": [
      "2160p",
      "1080p",
      "1080i",
      "720p",
      "480p"
     ],
     "type": "string"
    }
   },
   "required": [
    "MediaStreamId",
    "MediaStreamType",
    "MediaStreamName"
   ],
   "type": "object"
  },
  "MediaStreamAttributes": {
   "additionalProperties": false,
   "properties": {
    "Fmtp": {
     "$ref": "#/definitions/Fmtp"
    },
    "Lang": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "MediaStreamSourceConfiguration": {
   "additionalProperties": false,
   "properties": {
    "EncodingName": {
     "enum": [
      "jxsv",
      "raw",
      "smpte291",
      "pcm"
     ],
     "type": "string"
    },
    "InputConfigurations": {
     "items": {
      "$ref": "#/definitions/InputConfiguration"
     },
     "type": "array"
    },
    "MediaStreamName": {
     "type": "string"
    }
   },
   "required": [
    "EncodingName",
    "MediaStreamName"
   ],
   "type": "object"
  },
  "NdiConfig": {
   "additionalProperties": false,
   "properties": {
    "MachineName": {
     "type": "string"
    },
    "NdiDiscoveryServers": {
     "items": {
      "$ref": "#/definitions/NdiDiscoveryServerConfig"
     },
     "type": "array"
    },
    "NdiState": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    }
   },
   "type": "object"
  },
  "NdiDiscoveryServerConfig": {
   "additionalProperties": false,
   "properties": {
    "DiscoveryServerAddress": {
     "type": "string"
    },
    "DiscoveryServerPort": {
     "type": "integer"
    },
    "VpcInterfaceAdapter": {
     "type": "string"
    }
   },
   "required": [
    "DiscoveryServerAddress",
    "VpcInterfaceAdapter"
   ],
   "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"
  },
  "SilentAudio": {
   "additionalProperties": false,
   "properties": {
    "State": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    },
    "ThresholdSeconds": {
     "type": "integer"
    }
   },
   "type": "object"
  },
  "Source": {
   "additionalProperties": false,
   "properties": {
    "Decryption": {
     "$ref": "#/definitions/Encryption"
    },
    "Description": {
     "type": "string"
    },
    "EntitlementArn": {
     "pattern": "arn:.+:mediaconnect.+:entitlement:.+",
     "type": "string"
    },
    "GatewayBridgeSource": {
     "$ref": "#/definitions/GatewayBridgeSource"
    },
    "IngestIp": {
     "type": "string"
    },
    "IngestPort": {
     "type": "integer"
    },
    "MaxBitrate": {
     "type": "integer"
    },
    "MaxLatency": {
     "type": "integer"
    },
    "MaxSyncBuffer": {
     "type": "integer"
    },
    "MediaStreamSourceConfigurations": {
     "items": {
      "$ref": "#/definitions/MediaStreamSourceConfiguration"
     },
     "type": "array"
    },
    "MinLatency": {
     "type": "integer"
    },
    "Name": {
     "type": "string"
    },
    "Protocol": {
     "enum": [
      "zixi-push",
      "rtp-fec",
      "rtp",
      "rist",
      "fujitsu-qos",
      "srt-listener",
      "srt-caller",
      "st2110-jpegxs",
      "cdi"
     ],
     "type": "string"
    },
    "RouterIntegrationState": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    },
    "RouterIntegrationTransitDecryption": {
     "$ref": "#/definitions/FlowTransitEncryption"
    },
    "SenderControlPort": {
     "type": "integer"
    },
    "SenderIpAddress": {
     "type": "string"
    },
    "SourceArn": {
     "type": "string"
    },
    "SourceIngestPort": {
     "type": "string"
    },
    "SourceListenerAddress": {
     "type": "string"
    },
    "SourceListenerPort": {
     "type": "integer"
    },
    "StreamId": {
     "type": "string"
    },
    "Tags": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/Tag"
     },
     "type": "array"
    },
    "VpcInterfaceName": {
     "type": "string"
    },
    "WhitelistCidr": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "SourceMonitoringConfig": {
   "additionalProperties": false,
   "properties": {
    "AudioMonitoringSettings": {
     "items": {
      "$ref": "#/definitions/AudioMonitoringSetting"
     },
     "type": "array"
    },
    "ContentQualityAnalysisState": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    },
    "ThumbnailState": {
     "enum": [
      "ENABLED",
      "DISABLED"
     ],
     "type": "string"
    },
    "VideoMonitoringSettings": {
     "items": {
      "$ref": "#/definitions/VideoMonitoringSetting"
     },
     "type": "array"
    }
   },
   "type": "object"
  },
  "Tag": {
   "additionalProperties": false,
   "properties": {
    "Key": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "required": [
    "Key",
    "Value"
   ],
   "type": "object"
  },
  "VideoMonitoringSetting": {
   "additionalProperties": false,
   "properties": {
    "BlackFrames": {
     "$ref": "#/definitions/BlackFrames"
    },
    "FrozenFrames": {
     "$ref": "#/definitions/FrozenFrames"
    }
   },
   "type": "object"
  },
  "VpcInterface": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "type": "string"
    },
    "NetworkInterfaceIds": {
     "items": {
      "type": "string"
     },
     "type": "array"
    },
    "NetworkInterfaceType": {
     "enum": [
      "ena",
      "efa"
     ],
     "type": "string"
    },
    "RoleArn": {
     "format": "AWS::IAM::Role.Arn",
     "type": "string"
    },
    "SecurityGroupIds": {
     "format": "AWS::EC2::SecurityGroup.Ids",
     "items": {
      "format": "AWS::EC2::SecurityGroup.Id",
      "type": "string"
     },
     "type": "array"
    },
    "SubnetId": {
     "format": "AWS::EC2::Subnet.Id",
     "type": "string"
    },
    "Tags": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/Tag"
     },
     "type": "array"
    }
   },
   "required": [
    "Name",
    "RoleArn",
    "SecurityGroupIds",
    "SubnetId"
   ],
   "type": "object"
  },
  "VpcInterfaceAttachment": {
   "additionalProperties": false,
   "properties": {
    "VpcInterfaceName": {
     "type": "string"
    }
   },
   "type": "object"
  }
 },
 "deprecatedProperties": [
  "/properties/Source/EntitlementArn",
  "/properties/Source/SenderIpAddress",
  "/properties/Source/SenderControlPort",
  "/properties/Source/Decryption/ResourceId",
  "/properties/Source/Decryption/ConstantInitializationVector",
  "/properties/Source/Decryption/DeviceId",
  "/properties/Source/Decryption/Region",
  "/properties/Source/Decryption/Url"
 ],
 "primaryIdentifier": [
  "/properties/FlowArn"
 ],
 "properties": {
  "AvailabilityZone": {
   "type": "string"
  },
  "EgressIp": {
   "type": "string"
  },
  "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"
  },
  "FlowAvailabilityZone": {
   "type": "string"
  },
  "FlowNdiMachineName": {
   "type": "string"
  },
  "FlowSize": {
   "enum": [
    "MEDIUM",
    "LARGE"
   ],
   "type": "string"
  },
  "Maintenance": {
   "$ref": "#/definitions/Maintenance"
  },
  "MediaStreams": {
   "items": {
    "$ref": "#/definitions/MediaStream"
   },
   "type": "array"
  },
  "Name": {
   "type": "string"
  },
  "NdiConfig": {
   "$ref": "#/definitions/NdiConfig"
  },
  "Source": {
   "$ref": "#/definitions/Source"
  },
  "SourceFailoverConfig": {
   "$ref": "#/definitions/FailoverConfig"
  },
  "SourceMonitoringConfig": {
   "$ref": "#/definitions/SourceMonitoringConfig"
  },
  "Tags": {
   "insertionOrder": false,
   "items": {
    "$ref": "#/definitions/Tag"
   },
   "type": "array"
  },
  "VpcInterfaces": {
   "items": {
    "$ref": "#/definitions/VpcInterface"
   },
   "type": "array"
  }
 },
 "readOnlyProperties": [
  "/properties/FlowArn",
  "/properties/FlowAvailabilityZone",
  "/properties/Source/SourceArn",
  "/properties/Source/IngestIp",
  "/properties/Source/SourceIngestPort",
  "/properties/VpcInterfaces/*/NetworkInterfaceIds",
  "/properties/MediaStreams/*/Fmt",
  "/properties/EgressIp",
  "/properties/FlowNdiMachineName"
 ],
 "required": [
  "Name",
  "Source"
 ],
 "resourceLink": {
  "mappings": {
   "flowArn": "/FlowArn"
  },
  "templateUri": "/mediaconnect/home?region=${awsRegion}#/flows/${flowArn}"
 },
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-mediaconnect.git",
 "tagging": {
  "cloudFormationSystemTags": true,
  "tagOnCreate": true,
  "tagProperty": "/properties/Tags",
  "tagUpdatable": true,
  "taggable": true
 },
 "typeName": "AWS::MediaConnect::Flow"
}
