Menu
Amazon CloudFront
API Reference (API Version 2017-03-25)

CreateStreamingDistribution

Creates a new RMTP distribution. An RTMP distribution is similar to a web distribution, but an RTMP distribution streams media files using the Adobe Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP.

To create a new web distribution, submit a POST request to the CloudFront API version/distribution resource. The request body must include a document with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig element and returns other information about the RTMP distribution.

To get the status of your request, use the GET StreamingDistribution API action. When the value of Enabled is true and the value of Status is Deployed, your distribution is ready. A distribution usually deploys in less than 15 minutes.

For more information about web distributions, see Working with RTMP Distributions in the Amazon CloudFront Developer Guide.

Important

Beginning with the 2012-05-05 version of the CloudFront API, we made substantial changes to the format of the XML document that you include in the request body when you create or update a web distribution or an RTMP distribution, and when you invalidate objects. With previous versions of the API, we discovered that it was too easy to accidentally delete one or more values for an element that accepts multiple values, for example, CNAMEs and trusted signers. Our changes for the 2012-05-05 release are intended to prevent these accidental deletions and to notify you when there's a mismatch between the number of values you say you're specifying in the Quantity element and the number of values specified.

Request Syntax

Copy
POST /2017-03-25/streaming-distribution HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <StreamingDistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2017-03-25/"> <Aliases> <Items> <CNAME>string</CNAME> </Items> <Quantity>integer</Quantity> </Aliases> <CallerReference>string</CallerReference> <Comment>string</Comment> <Enabled>boolean</Enabled> <Logging> <Bucket>string</Bucket> <Enabled>boolean</Enabled> <Prefix>string</Prefix> </Logging> <PriceClass>string</PriceClass> <S3Origin> <DomainName>string</DomainName> <OriginAccessIdentity>string</OriginAccessIdentity> </S3Origin> <TrustedSigners> <Enabled>boolean</Enabled> <Items> <AwsAccountNumber>string</AwsAccountNumber> </Items> <Quantity>integer</Quantity> </TrustedSigners> </StreamingDistributionConfig>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in XML format.

StreamingDistributionConfig

Root level tag for the StreamingDistributionConfig parameters.

Required: Yes

Aliases

A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution.

Type: Aliases object

Required: No

CallerReference

A unique number that ensures that the request can't be replayed. If the CallerReference is new (no matter the content of the StreamingDistributionConfig object), a new streaming distribution is created. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution, and the content of the StreamingDistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request. If the CallerReference is a value that you already sent in a previous request to create a streaming distribution but the content of the StreamingDistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.

Type: String

Required: Yes

Comment

Any comments you want to include about the streaming distribution.

Type: String

Required: Yes

Enabled

Whether the streaming distribution is enabled to accept user requests for content.

Type: Boolean

Required: Yes

Logging

A complex type that controls whether access logs are written for the streaming distribution.

Type: StreamingLoggingConfig object

Required: No

PriceClass

A complex type that contains information about price class for this streaming distribution.

Type: String

Valid Values: PriceClass_100 | PriceClass_200 | PriceClass_All

Required: No

S3Origin

A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution.

Type: S3Origin object

Required: Yes

TrustedSigners

A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Type: TrustedSigners object

Required: Yes

Response Syntax

Copy
HTTP/1.1 201 <?xml version="1.0" encoding="UTF-8"?> <StreamingDistribution> <ActiveTrustedSigners> <Enabled>boolean</Enabled> <Items> <Signer> <AwsAccountNumber>string</AwsAccountNumber> <KeyPairIds> <Items> <KeyPairId>string</KeyPairId> </Items> <Quantity>integer</Quantity> </KeyPairIds> </Signer> </Items> <Quantity>integer</Quantity> </ActiveTrustedSigners> <ARN>string</ARN> <DomainName>string</DomainName> <Id>string</Id> <LastModifiedTime>timestamp</LastModifiedTime> <Status>string</Status> <StreamingDistributionConfig> <Aliases> <Items> <CNAME>string</CNAME> </Items> <Quantity>integer</Quantity> </Aliases> <CallerReference>string</CallerReference> <Comment>string</Comment> <Enabled>boolean</Enabled> <Logging> <Bucket>string</Bucket> <Enabled>boolean</Enabled> <Prefix>string</Prefix> </Logging> <PriceClass>string</PriceClass> <S3Origin> <DomainName>string</DomainName> <OriginAccessIdentity>string</OriginAccessIdentity> </S3Origin> <TrustedSigners> <Enabled>boolean</Enabled> <Items> <AwsAccountNumber>string</AwsAccountNumber> </Items> <Quantity>integer</Quantity> </TrustedSigners> </StreamingDistributionConfig> </StreamingDistribution>

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in XML format by the service.

StreamingDistribution

Root level tag for the StreamingDistribution parameters.

Required: Yes

ActiveTrustedSigners

A complex type that lists the AWS accounts, if any, that you included in the TrustedSigners complex type for this distribution. These are the accounts that you want to allow to create signed URLs for private content.

The Signer complex type lists the AWS account number of the trusted signer or self if the signer is the AWS account that created the distribution. The Signer element also includes the IDs of any active CloudFront key pairs that are associated with the trusted signer's AWS account. If no KeyPairId element appears for a Signer, that signer can't create signed URLs.

For more information, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Type: ActiveTrustedSigners object

ARN

Type: String

DomainName

The domain name that corresponds to the streaming distribution, for example, s5c39gqb8ow64r.cloudfront.net.

Type: String

Id

The identifier for the RTMP distribution. For example: EGTXBD79EXAMPLE.

Type: String

LastModifiedTime

The date and time that the distribution was last modified.

Type: Timestamp

Status

The current status of the RTMP distribution. When the status is Deployed, the distribution's information is propagated to all CloudFront edge locations.

Type: String

StreamingDistributionConfig

The current configuration information for the RTMP distribution.

Type: StreamingDistributionConfig object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDenied

Access denied.

HTTP Status Code: 403

CNAMEAlreadyExists

HTTP Status Code: 409

InconsistentQuantities

The value of Quantity and the size of Items don't match.

HTTP Status Code: 400

InvalidArgument

The argument is invalid.

HTTP Status Code: 400

InvalidOrigin

The Amazon S3 origin server specified does not refer to a valid Amazon S3 bucket.

HTTP Status Code: 400

InvalidOriginAccessIdentity

The origin access identity is not valid or doesn't exist.

HTTP Status Code: 400

MissingBody

This operation requires a body. Ensure that the body is present and the Content-Type header is set.

HTTP Status Code: 400

StreamingDistributionAlreadyExists

HTTP Status Code: 409

TooManyStreamingDistributionCNAMEs

HTTP Status Code: 400

TooManyStreamingDistributions

Processing your request would cause you to exceed the maximum number of streaming distributions allowed.

HTTP Status Code: 400

TooManyTrustedSigners

Your request contains more trusted signers than are allowed per distribution.

HTTP Status Code: 400

TrustedSignerDoesNotExist

One or more of your trusted signers don't exist.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: