import { Command as $Command } from "@smithy/smithy-client"; import { MetadataBearer as __MetadataBearer } from "@smithy/types"; import { CloudFrontClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudFrontClient"; import { CreateOriginRequestPolicyRequest, CreateOriginRequestPolicyResult } from "../models/models_1"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link CreateOriginRequestPolicyCommand}. */ export interface CreateOriginRequestPolicyCommandInput extends CreateOriginRequestPolicyRequest { } /** * @public * * The output of {@link CreateOriginRequestPolicyCommand}. */ export interface CreateOriginRequestPolicyCommandOutput extends CreateOriginRequestPolicyResult, __MetadataBearer { } declare const CreateOriginRequestPolicyCommand_base: { new (input: CreateOriginRequestPolicyCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: CreateOriginRequestPolicyCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

Creates an origin request policy.

After you create an origin request policy, you can attach it to one or more cache behaviors. When it's attached to a cache behavior, the origin request policy determines the values that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin includes the following:

CloudFront sends a request when it can't find a valid object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use CachePolicy.

For more information about origin request policies, see Controlling origin requests in the Amazon CloudFront Developer Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { CloudFrontClient, CreateOriginRequestPolicyCommand } from "@aws-sdk/client-cloudfront"; // ES Modules import * // const { CloudFrontClient, CreateOriginRequestPolicyCommand } = require("@aws-sdk/client-cloudfront"); // CommonJS import * const client = new CloudFrontClient(config); * const input = { // CreateOriginRequestPolicyRequest * OriginRequestPolicyConfig: { // OriginRequestPolicyConfig * Comment: "STRING_VALUE", * Name: "STRING_VALUE", // required * HeadersConfig: { // OriginRequestPolicyHeadersConfig * HeaderBehavior: "none" || "whitelist" || "allViewer" || "allViewerAndWhitelistCloudFront" || "allExcept", // required * Headers: { // Headers * Quantity: Number("int"), // required * Items: [ // HeaderList * "STRING_VALUE", * ], * }, * }, * CookiesConfig: { // OriginRequestPolicyCookiesConfig * CookieBehavior: "none" || "whitelist" || "all" || "allExcept", // required * Cookies: { // CookieNames * Quantity: Number("int"), // required * Items: [ // CookieNameList * "STRING_VALUE", * ], * }, * }, * QueryStringsConfig: { // OriginRequestPolicyQueryStringsConfig * QueryStringBehavior: "none" || "whitelist" || "all" || "allExcept", // required * QueryStrings: { // QueryStringNames * Quantity: Number("int"), // required * Items: [ // QueryStringNamesList * "STRING_VALUE", * ], * }, * }, * }, * }; * const command = new CreateOriginRequestPolicyCommand(input); * const response = await client.send(command); * // { // CreateOriginRequestPolicyResult * // OriginRequestPolicy: { // OriginRequestPolicy * // Id: "STRING_VALUE", // required * // LastModifiedTime: new Date("TIMESTAMP"), // required * // OriginRequestPolicyConfig: { // OriginRequestPolicyConfig * // Comment: "STRING_VALUE", * // Name: "STRING_VALUE", // required * // HeadersConfig: { // OriginRequestPolicyHeadersConfig * // HeaderBehavior: "none" || "whitelist" || "allViewer" || "allViewerAndWhitelistCloudFront" || "allExcept", // required * // Headers: { // Headers * // Quantity: Number("int"), // required * // Items: [ // HeaderList * // "STRING_VALUE", * // ], * // }, * // }, * // CookiesConfig: { // OriginRequestPolicyCookiesConfig * // CookieBehavior: "none" || "whitelist" || "all" || "allExcept", // required * // Cookies: { // CookieNames * // Quantity: Number("int"), // required * // Items: [ // CookieNameList * // "STRING_VALUE", * // ], * // }, * // }, * // QueryStringsConfig: { // OriginRequestPolicyQueryStringsConfig * // QueryStringBehavior: "none" || "whitelist" || "all" || "allExcept", // required * // QueryStrings: { // QueryStringNames * // Quantity: Number("int"), // required * // Items: [ // QueryStringNamesList * // "STRING_VALUE", * // ], * // }, * // }, * // }, * // }, * // Location: "STRING_VALUE", * // ETag: "STRING_VALUE", * // }; * * ``` * * @param CreateOriginRequestPolicyCommandInput - {@link CreateOriginRequestPolicyCommandInput} * @returns {@link CreateOriginRequestPolicyCommandOutput} * @see {@link CreateOriginRequestPolicyCommandInput} for command's `input` shape. * @see {@link CreateOriginRequestPolicyCommandOutput} for command's `response` shape. * @see {@link CloudFrontClientResolvedConfig | config} for CloudFrontClient's `config` shape. * * @throws {@link AccessDenied} (client fault) *

Access denied.

* * @throws {@link InconsistentQuantities} (client fault) *

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

* * @throws {@link InvalidArgument} (client fault) *

An argument is invalid.

* * @throws {@link OriginRequestPolicyAlreadyExists} (client fault) *

An origin request policy with this name already exists. You must provide a unique name. To modify an existing origin request policy, use UpdateOriginRequestPolicy.

* * @throws {@link TooManyCookiesInOriginRequestPolicy} (client fault) *

The number of cookies in the origin request policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.

* * @throws {@link TooManyHeadersInOriginRequestPolicy} (client fault) *

The number of headers in the origin request policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.

* * @throws {@link TooManyOriginRequestPolicies} (client fault) *

You have reached the maximum number of origin request policies for this Amazon Web Services account. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.

* * @throws {@link TooManyQueryStringsInOriginRequestPolicy} (client fault) *

The number of query strings in the origin request policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.

* * @throws {@link CloudFrontServiceException} *

Base exception class for all service exceptions from CloudFront service.

* * * @public */ export declare class CreateOriginRequestPolicyCommand extends CreateOriginRequestPolicyCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateOriginRequestPolicyRequest; output: CreateOriginRequestPolicyResult; }; sdk: { input: CreateOriginRequestPolicyCommandInput; output: CreateOriginRequestPolicyCommandOutput; }; }; }