- 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.
GetOriginRequestPolicyConfigCommand
Gets an origin request policy configuration.
To get an origin request policy configuration, you must provide the policy's identifier. If the origin request policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions
or GetDistribution
. If the origin request policy is not attached to a cache behavior, you can get the identifier using ListOriginRequestPolicies
.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudFrontClient, GetOriginRequestPolicyConfigCommand } from "@aws-sdk/client-cloudfront"; // ES Modules import
// const { CloudFrontClient, GetOriginRequestPolicyConfigCommand } = require("@aws-sdk/client-cloudfront"); // CommonJS import
const client = new CloudFrontClient(config);
const input = { // GetOriginRequestPolicyConfigRequest
Id: "STRING_VALUE", // required
};
const command = new GetOriginRequestPolicyConfigCommand(input);
const response = await client.send(command);
// { // GetOriginRequestPolicyConfigResult
// 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",
// ],
// },
// },
// },
// ETag: "STRING_VALUE",
// };
GetOriginRequestPolicyConfigCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Id Required | string | undefined | The unique identifier for the origin request policy. If the origin request policy is attached to a distribution's cache behavior, you can get the policy's identifier using |
GetOriginRequestPolicyConfigCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ETag | string | undefined | The current version of the origin request policy. |
OriginRequestPolicyConfig | OriginRequestPolicyConfig | undefined | The origin request policy configuration. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDenied | client | Access denied. |
NoSuchOriginRequestPolicy | client | The origin request policy does not exist. |
CloudFrontServiceException | Base exception class for all service exceptions from CloudFront service. |