{
  "typeName" : "AWS::MediaConnect::FlowOutput",
  "description" : "Resource schema for AWS::MediaConnect::FlowOutput",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-mediaconnect.git",
  "definitions" : {
    "Tag" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "required" : [ "Key", "Value" ]
    },
    "Encryption" : {
      "type" : "object",
      "description" : "Information about the encryption of the flow.",
      "properties" : {
        "Algorithm" : {
          "type" : "string",
          "enum" : [ "aes128", "aes192", "aes256" ],
          "description" : "The type of algorithm that is used for the encryption (such as aes128, aes192, or aes256)."
        },
        "KeyType" : {
          "type" : "string",
          "enum" : [ "static-key", "srt-password" ],
          "description" : "The type of key that is used for the encryption. If no keyType is provided, the service will use the default setting (static-key).",
          "default" : "static-key"
        },
        "RoleArn" : {
          "type" : "string",
          "pattern" : "^arn:(aws[a-zA-Z-]*):iam::[0-9]{12}:role/[a-zA-Z0-9_+=,.@-]+$",
          "description" : "The ARN of the role that you created during setup (when you set up AWS Elemental MediaConnect as a trusted entity)."
        },
        "SecretArn" : {
          "type" : "string",
          "pattern" : "^arn:(aws[a-zA-Z-]*):secretsmanager:[a-z0-9-]+:[0-9]{12}:secret:[a-zA-Z0-9/_+=.@-]+$",
          "description" : " The ARN of the secret that you created in AWS Secrets Manager to store the encryption key. This parameter is required for static key encryption and is not valid for SPEKE encryption."
        }
      },
      "additionalProperties" : false,
      "required" : [ "RoleArn", "SecretArn" ]
    },
    "VpcInterfaceAttachment" : {
      "type" : "object",
      "description" : "The settings for attaching a VPC interface to an output.",
      "properties" : {
        "VpcInterfaceName" : {
          "type" : "string",
          "description" : "The name of the VPC interface to use for this output."
        }
      },
      "additionalProperties" : false
    },
    "MediaStreamOutputConfiguration" : {
      "type" : "object",
      "description" : "The media stream that is associated with the output, and the parameters for that association.",
      "properties" : {
        "EncodingName" : {
          "type" : "string",
          "description" : "The format that will be used to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video streams on sources or outputs that use the CDI protocol, set the encoding name to raw. For video streams on sources or outputs that use the ST 2110 JPEG XS protocol, set the encoding name to jxsv.",
          "enum" : [ "jxsv", "raw", "smpte291", "pcm" ]
        },
        "DestinationConfigurations" : {
          "type" : "array",
          "description" : "The media streams that you want to associate with the output.",
          "items" : {
            "$ref" : "#/definitions/DestinationConfiguration"
          }
        },
        "MediaStreamName" : {
          "type" : "string",
          "description" : "A name that helps you distinguish one media stream from another."
        },
        "EncodingParameters" : {
          "$ref" : "#/definitions/EncodingParameters",
          "description" : "A collection of parameters that determine how MediaConnect will convert the content. These fields only apply to outputs on flows that have a CDI source."
        }
      },
      "additionalProperties" : false,
      "required" : [ "EncodingName", "MediaStreamName" ]
    },
    "DestinationConfiguration" : {
      "type" : "object",
      "description" : "The definition of a media stream that is associated with the output.",
      "properties" : {
        "DestinationIp" : {
          "type" : "string",
          "description" : "The IP address where contents of the media stream will be sent."
        },
        "DestinationPort" : {
          "type" : "integer",
          "description" : "The port to use when the content of the media stream is distributed to the output."
        },
        "Interface" : {
          "$ref" : "#/definitions/Interface",
          "description" : "The VPC interface that is used for the media stream associated with the output."
        }
      },
      "additionalProperties" : false,
      "required" : [ "DestinationIp", "DestinationPort", "Interface" ]
    },
    "Interface" : {
      "type" : "object",
      "description" : "The VPC interface that you want to use for the media stream associated with the output.",
      "properties" : {
        "Name" : {
          "type" : "string",
          "description" : "The name of the VPC interface that you want to use for the media stream associated with the output."
        }
      },
      "additionalProperties" : false,
      "required" : [ "Name" ]
    },
    "EncodingParameters" : {
      "type" : "object",
      "description" : "A collection of parameters that determine how MediaConnect will convert the content. These fields only apply to outputs on flows that have a CDI source.",
      "properties" : {
        "CompressionFactor" : {
          "type" : "number",
          "description" : "A value that is used to calculate compression for an output. The bitrate of the output is calculated as follows: Output bitrate = (1 / compressionFactor) * (source bitrate) This property only applies to outputs that use the ST 2110 JPEG XS protocol, with a flow source that uses the CDI protocol. Valid values are in the range of 3.0 to 10.0, inclusive."
        },
        "EncoderProfile" : {
          "type" : "string",
          "description" : "A setting on the encoder that drives compression settings. This property only applies to video media streams associated with outputs that use the ST 2110 JPEG XS protocol, with a flow source that uses the CDI protocol.",
          "enum" : [ "main", "high" ]
        }
      },
      "additionalProperties" : false,
      "required" : [ "CompressionFactor" ]
    },
    "FlowTransitEncryption" : {
      "type" : "object",
      "description" : "The configuration that defines how content is encrypted during transit between the MediaConnect router and a MediaConnect flow.",
      "properties" : {
        "EncryptionKeyType" : {
          "$ref" : "#/definitions/FlowTransitEncryptionKeyType"
        },
        "EncryptionKeyConfiguration" : {
          "$ref" : "#/definitions/FlowTransitEncryptionKeyConfiguration"
        }
      },
      "required" : [ "EncryptionKeyConfiguration" ],
      "additionalProperties" : false
    },
    "FlowTransitEncryptionKeyConfiguration" : {
      "description" : "Configuration settings for flow transit encryption keys.",
      "oneOf" : [ {
        "type" : "object",
        "title" : "SecretsManager",
        "properties" : {
          "SecretsManager" : {
            "$ref" : "#/definitions/SecretsManagerEncryptionKeyConfiguration"
          }
        },
        "required" : [ "SecretsManager" ],
        "additionalProperties" : false
      }, {
        "type" : "object",
        "title" : "Automatic",
        "properties" : {
          "Automatic" : {
            "$ref" : "#/definitions/AutomaticEncryptionKeyConfiguration"
          }
        },
        "required" : [ "Automatic" ],
        "additionalProperties" : false
      } ]
    },
    "FlowTransitEncryptionKeyType" : {
      "type" : "string",
      "enum" : [ "SECRETS_MANAGER", "AUTOMATIC" ]
    },
    "SecretsManagerEncryptionKeyConfiguration" : {
      "type" : "object",
      "description" : "The configuration settings for transit encryption of a flow output using AWS Secrets Manager, including the secret ARN and role ARN.",
      "properties" : {
        "SecretArn" : {
          "type" : "string",
          "pattern" : "^arn:(aws[a-zA-Z-]*):secretsmanager:[a-z0-9-]+:[0-9]{12}:secret:[a-zA-Z0-9/_+=.@-]+$",
          "description" : "The ARN of the AWS Secrets Manager secret used for transit encryption to the router input."
        },
        "RoleArn" : {
          "type" : "string",
          "pattern" : "^arn:(aws[a-zA-Z-]*):iam::[0-9]{12}:role/[a-zA-Z0-9_+=,.@-]+$",
          "description" : "The ARN of the IAM role used for transit encryption to the router input using AWS Secrets Manager."
        }
      },
      "required" : [ "RoleArn", "SecretArn" ],
      "additionalProperties" : false
    },
    "AutomaticEncryptionKeyConfiguration" : {
      "type" : "object",
      "description" : "Configuration settings for automatic encryption key management, where MediaConnect handles key creation and rotation.",
      "additionalProperties" : false
    }
  },
  "properties" : {
    "FlowArn" : {
      "description" : "The Amazon Resource Name (ARN), a unique identifier for any AWS resource, of the flow.",
      "pattern" : "^arn:(aws[a-zA-Z-]*):mediaconnect:[a-z0-9-]+:[0-9]{12}:flow:[a-zA-Z0-9-]+:[a-zA-Z0-9_-]+$",
      "type" : "string"
    },
    "OutputArn" : {
      "description" : "The ARN of the output.",
      "pattern" : "^arn:(aws[a-zA-Z-]*):mediaconnect:[a-z0-9-]+:[0-9]{12}:output:[a-zA-Z0-9-]+:[a-zA-Z0-9_-]+$",
      "type" : "string"
    },
    "CidrAllowList" : {
      "type" : "array",
      "description" : "The range of IP addresses that should be allowed to initiate output requests to this flow. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.",
      "items" : {
        "type" : "string"
      }
    },
    "Encryption" : {
      "$ref" : "#/definitions/Encryption",
      "description" : "The type of key used for the encryption. If no keyType is provided, the service will use the default setting (static-key)."
    },
    "Description" : {
      "type" : "string",
      "description" : "A description of the output."
    },
    "Destination" : {
      "type" : "string",
      "description" : "The address where you want to send the output."
    },
    "MaxLatency" : {
      "type" : "integer",
      "description" : "The maximum latency in milliseconds. This parameter applies only to RIST-based and Zixi-based streams."
    },
    "MinLatency" : {
      "type" : "integer",
      "description" : "The minimum latency in milliseconds."
    },
    "Name" : {
      "type" : "string",
      "description" : "The name of the output. This value must be unique within the current flow."
    },
    "Port" : {
      "type" : "integer",
      "description" : "The port to use when content is distributed to this output."
    },
    "Protocol" : {
      "type" : "string",
      "enum" : [ "zixi-push", "rtp-fec", "rtp", "zixi-pull", "rist", "srt-listener", "srt-caller", "st2110-jpegxs", "cdi", "ndi-speed-hq" ],
      "description" : "The protocol that is used by the source or output."
    },
    "RemoteId" : {
      "type" : "string",
      "description" : "The remote ID for the Zixi-pull stream."
    },
    "SmoothingLatency" : {
      "type" : "integer",
      "description" : "The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams."
    },
    "StreamId" : {
      "type" : "string",
      "description" : "The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams."
    },
    "VpcInterfaceAttachment" : {
      "$ref" : "#/definitions/VpcInterfaceAttachment",
      "description" : "The name of the VPC interface attachment to use for this output."
    },
    "MediaStreamOutputConfigurations" : {
      "type" : "array",
      "description" : "The definition for each media stream that is associated with the output.",
      "items" : {
        "$ref" : "#/definitions/MediaStreamOutputConfiguration"
      }
    },
    "OutputStatus" : {
      "type" : "string",
      "enum" : [ "ENABLED", "DISABLED" ],
      "description" : "An indication of whether the output should transmit data or not."
    },
    "NdiProgramName" : {
      "type" : "string",
      "description" : "A suffix for the names of the NDI sources that the flow creates. If a custom name isn't specified, MediaConnect uses the output name."
    },
    "NdiSpeedHqQuality" : {
      "type" : "integer",
      "description" : "A quality setting for the NDI Speed HQ encoder."
    },
    "RouterIntegrationState" : {
      "type" : "string",
      "enum" : [ "ENABLED", "DISABLED" ]
    },
    "RouterIntegrationTransitEncryption" : {
      "$ref" : "#/definitions/FlowTransitEncryption"
    },
    "Tags" : {
      "type" : "array",
      "description" : "Key-value pairs that can be used to tag and organize this flow output.",
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "FlowArn" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/FlowArn" ],
  "readOnlyProperties" : [ "/properties/OutputArn" ],
  "primaryIdentifier" : [ "/properties/OutputArn" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "mediaconnect:TagResource", "mediaconnect:UntagResource", "mediaconnect:ListTagsForResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "iam:PassRole", "mediaconnect:AddFlowOutputs", "mediaconnect:DescribeFlow", "mediaconnect:TagResource", "mediaconnect:ListTagsForResource" ]
    },
    "read" : {
      "permissions" : [ "mediaconnect:DescribeFlow", "mediaconnect:ListFlows", "mediaconnect:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "iam:PassRole", "mediaconnect:DescribeFlow", "mediaconnect:UpdateFlowOutput", "mediaconnect:TagResource", "mediaconnect:UntagResource", "mediaconnect:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "mediaconnect:DescribeFlow", "mediaconnect:ListFlows", "mediaconnect:RemoveFlowOutput" ]
    },
    "list" : {
      "permissions" : [ "mediaconnect:DescribeFlow", "mediaconnect:ListFlows" ],
      "handlerSchema" : {
        "properties" : {
          "FlowArn" : {
            "$ref" : "resource-schema.json#/properties/FlowArn"
          }
        },
        "required" : [ "FlowArn" ]
      }
    }
  }
}