- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateStreamingDistributionCommand
This API is deprecated. Amazon CloudFront is deprecating real-time messaging protocol (RTMP) distributions on December 31, 2020. For more information, read the announcement on the Amazon CloudFront discussion forum.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudFrontClient, CreateStreamingDistributionCommand } from "@aws-sdk/client-cloudfront"; // ES Modules import
// const { CloudFrontClient, CreateStreamingDistributionCommand } = require("@aws-sdk/client-cloudfront"); // CommonJS import
const client = new CloudFrontClient(config);
const input = { // CreateStreamingDistributionRequest
StreamingDistributionConfig: { // StreamingDistributionConfig
CallerReference: "STRING_VALUE", // required
S3Origin: { // S3Origin
DomainName: "STRING_VALUE", // required
OriginAccessIdentity: "STRING_VALUE", // required
},
Aliases: { // Aliases
Quantity: Number("int"), // required
Items: [ // AliasList
"STRING_VALUE",
],
},
Comment: "STRING_VALUE", // required
Logging: { // StreamingLoggingConfig
Enabled: true || false, // required
Bucket: "STRING_VALUE", // required
Prefix: "STRING_VALUE", // required
},
TrustedSigners: { // TrustedSigners
Enabled: true || false, // required
Quantity: Number("int"), // required
Items: [ // AwsAccountNumberList
"STRING_VALUE",
],
},
PriceClass: "PriceClass_100" || "PriceClass_200" || "PriceClass_All",
Enabled: true || false, // required
},
};
const command = new CreateStreamingDistributionCommand(input);
const response = await client.send(command);
// { // CreateStreamingDistributionResult
// StreamingDistribution: { // StreamingDistribution
// Id: "STRING_VALUE", // required
// ARN: "STRING_VALUE", // required
// Status: "STRING_VALUE", // required
// LastModifiedTime: new Date("TIMESTAMP"),
// DomainName: "STRING_VALUE", // required
// ActiveTrustedSigners: { // ActiveTrustedSigners
// Enabled: true || false, // required
// Quantity: Number("int"), // required
// Items: [ // SignerList
// { // Signer
// AwsAccountNumber: "STRING_VALUE",
// KeyPairIds: { // KeyPairIds
// Quantity: Number("int"), // required
// Items: [ // KeyPairIdList
// "STRING_VALUE",
// ],
// },
// },
// ],
// },
// StreamingDistributionConfig: { // StreamingDistributionConfig
// CallerReference: "STRING_VALUE", // required
// S3Origin: { // S3Origin
// DomainName: "STRING_VALUE", // required
// OriginAccessIdentity: "STRING_VALUE", // required
// },
// Aliases: { // Aliases
// Quantity: Number("int"), // required
// Items: [ // AliasList
// "STRING_VALUE",
// ],
// },
// Comment: "STRING_VALUE", // required
// Logging: { // StreamingLoggingConfig
// Enabled: true || false, // required
// Bucket: "STRING_VALUE", // required
// Prefix: "STRING_VALUE", // required
// },
// TrustedSigners: { // TrustedSigners
// Enabled: true || false, // required
// Quantity: Number("int"), // required
// Items: [ // AwsAccountNumberList
// "STRING_VALUE",
// ],
// },
// PriceClass: "PriceClass_100" || "PriceClass_200" || "PriceClass_All",
// Enabled: true || false, // required
// },
// },
// Location: "STRING_VALUE",
// ETag: "STRING_VALUE",
// };
CreateStreamingDistributionCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
StreamingDistributionConfig Required | StreamingDistributionConfig | undefined | The streaming distribution's configuration information. |
CreateStreamingDistributionCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ETag | string | undefined | The current version of the streaming distribution created. |
Location | string | undefined | The fully qualified URI of the new streaming distribution resource just created. |
StreamingDistribution | StreamingDistribution | undefined | The streaming distribution's information. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDenied | client | Access denied. |
CNAMEAlreadyExists | client | The CNAME specified is already defined for CloudFront. |
InconsistentQuantities | client | The value of |
InvalidArgument | client | An argument is invalid. |
InvalidOrigin | client | The Amazon S3 origin server specified does not refer to a valid Amazon S3 bucket. |
InvalidOriginAccessControl | client | The origin access control is not valid. |
InvalidOriginAccessIdentity | client | The origin access identity is not valid or doesn't exist. |
MissingBody | client | This operation requires a body. Ensure that the body is present and the |
StreamingDistributionAlreadyExists | client | The caller reference you attempted to create the streaming distribution with is associated with another distribution |
TooManyStreamingDistributionCNAMEs | client | Your request contains more CNAMEs than are allowed per distribution. |
TooManyStreamingDistributions | client | Processing your request would cause you to exceed the maximum number of streaming distributions allowed. |
TooManyTrustedSigners | client | Your request contains more trusted signers than are allowed per distribution. |
TrustedSignerDoesNotExist | client | One or more of your trusted signers don't exist. |
CloudFrontServiceException | Base exception class for all service exceptions from CloudFront service. |