- 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.
ListResponseHeadersPoliciesCommand
Gets a list of response headers policies.
You can optionally apply a filter to get only the managed policies created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account.
You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subsequent request that specifies the NextMarker
value from the current response as the Marker
value in the subsequent request.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudFrontClient, ListResponseHeadersPoliciesCommand } from "@aws-sdk/client-cloudfront"; // ES Modules import
// const { CloudFrontClient, ListResponseHeadersPoliciesCommand } = require("@aws-sdk/client-cloudfront"); // CommonJS import
const client = new CloudFrontClient(config);
const input = { // ListResponseHeadersPoliciesRequest
Type: "managed" || "custom",
Marker: "STRING_VALUE",
MaxItems: Number("int"),
};
const command = new ListResponseHeadersPoliciesCommand(input);
const response = await client.send(command);
// { // ListResponseHeadersPoliciesResult
// ResponseHeadersPolicyList: { // ResponseHeadersPolicyList
// NextMarker: "STRING_VALUE",
// MaxItems: Number("int"), // required
// Quantity: Number("int"), // required
// Items: [ // ResponseHeadersPolicySummaryList
// { // ResponseHeadersPolicySummary
// Type: "managed" || "custom", // required
// ResponseHeadersPolicy: { // ResponseHeadersPolicy
// Id: "STRING_VALUE", // required
// LastModifiedTime: new Date("TIMESTAMP"), // required
// ResponseHeadersPolicyConfig: { // ResponseHeadersPolicyConfig
// Comment: "STRING_VALUE",
// Name: "STRING_VALUE", // required
// CorsConfig: { // ResponseHeadersPolicyCorsConfig
// AccessControlAllowOrigins: { // ResponseHeadersPolicyAccessControlAllowOrigins
// Quantity: Number("int"), // required
// Items: [ // AccessControlAllowOriginsList // required
// "STRING_VALUE",
// ],
// },
// AccessControlAllowHeaders: { // ResponseHeadersPolicyAccessControlAllowHeaders
// Quantity: Number("int"), // required
// Items: [ // AccessControlAllowHeadersList // required
// "STRING_VALUE",
// ],
// },
// AccessControlAllowMethods: { // ResponseHeadersPolicyAccessControlAllowMethods
// Quantity: Number("int"), // required
// Items: [ // AccessControlAllowMethodsList // required
// "GET" || "POST" || "OPTIONS" || "PUT" || "DELETE" || "PATCH" || "HEAD" || "ALL",
// ],
// },
// AccessControlAllowCredentials: true || false, // required
// AccessControlExposeHeaders: { // ResponseHeadersPolicyAccessControlExposeHeaders
// Quantity: Number("int"), // required
// Items: [ // AccessControlExposeHeadersList
// "STRING_VALUE",
// ],
// },
// AccessControlMaxAgeSec: Number("int"),
// OriginOverride: true || false, // required
// },
// SecurityHeadersConfig: { // ResponseHeadersPolicySecurityHeadersConfig
// XSSProtection: { // ResponseHeadersPolicyXSSProtection
// Override: true || false, // required
// Protection: true || false, // required
// ModeBlock: true || false,
// ReportUri: "STRING_VALUE",
// },
// FrameOptions: { // ResponseHeadersPolicyFrameOptions
// Override: true || false, // required
// FrameOption: "DENY" || "SAMEORIGIN", // required
// },
// ReferrerPolicy: { // ResponseHeadersPolicyReferrerPolicy
// Override: true || false, // required
// ReferrerPolicy: "no-referrer" || "no-referrer-when-downgrade" || "origin" || "origin-when-cross-origin" || "same-origin" || "strict-origin" || "strict-origin-when-cross-origin" || "unsafe-url", // required
// },
// ContentSecurityPolicy: { // ResponseHeadersPolicyContentSecurityPolicy
// Override: true || false, // required
// ContentSecurityPolicy: "STRING_VALUE", // required
// },
// ContentTypeOptions: { // ResponseHeadersPolicyContentTypeOptions
// Override: true || false, // required
// },
// StrictTransportSecurity: { // ResponseHeadersPolicyStrictTransportSecurity
// Override: true || false, // required
// IncludeSubdomains: true || false,
// Preload: true || false,
// AccessControlMaxAgeSec: Number("int"), // required
// },
// },
// ServerTimingHeadersConfig: { // ResponseHeadersPolicyServerTimingHeadersConfig
// Enabled: true || false, // required
// SamplingRate: Number("double"),
// },
// CustomHeadersConfig: { // ResponseHeadersPolicyCustomHeadersConfig
// Quantity: Number("int"), // required
// Items: [ // ResponseHeadersPolicyCustomHeaderList
// { // ResponseHeadersPolicyCustomHeader
// Header: "STRING_VALUE", // required
// Value: "STRING_VALUE", // required
// Override: true || false, // required
// },
// ],
// },
// RemoveHeadersConfig: { // ResponseHeadersPolicyRemoveHeadersConfig
// Quantity: Number("int"), // required
// Items: [ // ResponseHeadersPolicyRemoveHeaderList
// { // ResponseHeadersPolicyRemoveHeader
// Header: "STRING_VALUE", // required
// },
// ],
// },
// },
// },
// },
// ],
// },
// };
ListResponseHeadersPoliciesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Marker | string | undefined | Use this field when paginating results to indicate where to begin in your list of response headers policies. The response includes response headers policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of |
MaxItems | number | undefined | The maximum number of response headers policies that you want to get in the response. |
Type | ResponseHeadersPolicyType | undefined | A filter to get only the specified kind of response headers policies. Valid values are:
|
ListResponseHeadersPoliciesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ResponseHeadersPolicyList | ResponseHeadersPolicyList | undefined | A list of response headers policies. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDenied | client | Access denied. |
InvalidArgument | client | An argument is invalid. |
NoSuchResponseHeadersPolicy | client | The response headers policy does not exist. |
CloudFrontServiceException | Base exception class for all service exceptions from CloudFront service. |