createDistribution2018_06_18 method

Future<CreateDistributionResult> createDistribution2018_06_18(
  1. {@required DistributionConfig distributionConfig}

Creates a new web distribution. You create a CloudFront distribution to tell CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery. Send a POST request to the /CloudFront API version/distribution/distribution ID resource. When you update a distribution, there are more required fields than when you create a distribution. When you update your distribution by using UpdateDistribution, follow the steps included in the documentation to get the current configuration and then make your updates. This helps to make sure that you include all of the required fields. To view a summary, see Required Fields for Create Distribution and Update Distribution in the Amazon CloudFront Developer Guide. If you are using Adobe Flash Media Server's RTMP protocol, you set up a different kind of CloudFront distribution. For more information, see CreateStreamingDistribution.

May throw CNAMEAlreadyExists. May throw DistributionAlreadyExists. May throw InvalidOrigin. May throw InvalidOriginAccessIdentity. May throw AccessDenied. May throw TooManyTrustedSigners. May throw TrustedSignerDoesNotExist. May throw InvalidViewerCertificate. May throw InvalidMinimumProtocolVersion. May throw MissingBody. May throw TooManyDistributionCNAMEs. May throw TooManyDistributions. May throw InvalidDefaultRootObject. May throw InvalidRelativePath. May throw InvalidErrorCode. May throw InvalidResponseCode. May throw InvalidArgument. May throw InvalidRequiredProtocol. May throw NoSuchOrigin. May throw TooManyOrigins. May throw TooManyCacheBehaviors. May throw TooManyCookieNamesInWhiteList. May throw InvalidForwardCookies. May throw TooManyHeadersInForwardedValues. May throw InvalidHeadersForS3Origin. May throw InconsistentQuantities. May throw TooManyCertificates. May throw InvalidLocationCode. May throw InvalidGeoRestrictionParameter. May throw InvalidProtocolSettings. May throw InvalidTTLOrder. May throw InvalidWebACLId. May throw TooManyOriginCustomHeaders. May throw TooManyQueryStringParameters. May throw InvalidQueryStringParameters. May throw TooManyDistributionsWithLambdaAssociations. May throw TooManyLambdaFunctionAssociations. May throw InvalidLambdaFunctionAssociation. May throw InvalidOriginReadTimeout. May throw InvalidOriginKeepaliveTimeout. May throw NoSuchFieldLevelEncryptionConfig. May throw IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior. May throw TooManyDistributionsAssociatedToFieldLevelEncryptionConfig.

Parameter distributionConfig : The distribution's configuration information.


Future<CreateDistributionResult> createDistribution2018_06_18({
  @_s.required DistributionConfig distributionConfig,
}) async {
  ArgumentError.checkNotNull(distributionConfig, 'distributionConfig');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2018-06-18/distribution',
    payload: distributionConfig.toXml('DistributionConfig'),
    exceptionFnMap: _exceptionFns,
  final $elem = await _s.xmlFromResponse($result);
  return CreateDistributionResult(
    distribution: Distribution.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),