@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.731Z") @Stability(value=Stable) public class CfnOriginRequestPolicy extends CfnResource implements IInspectable
An origin request policy.
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:
Host , User-Agent , and X-Amz-Cf-Id .
CloudFront sends a request when it can’t find an 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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;
CfnOriginRequestPolicy cfnOriginRequestPolicy = CfnOriginRequestPolicy.Builder.create(this, "MyCfnOriginRequestPolicy")
.originRequestPolicyConfig(OriginRequestPolicyConfigProperty.builder()
.cookiesConfig(CookiesConfigProperty.builder()
.cookieBehavior("cookieBehavior")
// the properties below are optional
.cookies(List.of("cookies"))
.build())
.headersConfig(HeadersConfigProperty.builder()
.headerBehavior("headerBehavior")
// the properties below are optional
.headers(List.of("headers"))
.build())
.name("name")
.queryStringsConfig(QueryStringsConfigProperty.builder()
.queryStringBehavior("queryStringBehavior")
// the properties below are optional
.queryStrings(List.of("queryStrings"))
.build())
// the properties below are optional
.comment("comment")
.build())
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnOriginRequestPolicy.Builder
A fluent builder for
CfnOriginRequestPolicy. |
static interface |
CfnOriginRequestPolicy.CookiesConfigProperty
An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in requests that CloudFront sends to the origin.
|
static interface |
CfnOriginRequestPolicy.HeadersConfigProperty
An object that determines whether any HTTP headers (and if so, which headers) are included in requests that CloudFront sends to the origin.
|
static interface |
CfnOriginRequestPolicy.OriginRequestPolicyConfigProperty
An origin request policy configuration.
|
static interface |
CfnOriginRequestPolicy.QueryStringsConfigProperty
An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in requests that CloudFront sends to the origin.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnOriginRequestPolicy(Construct scope,
String id,
CfnOriginRequestPolicyProps props)
Create a new `AWS::CloudFront::OriginRequestPolicy`.
|
protected |
CfnOriginRequestPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnOriginRequestPolicy(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrId()
The unique identifier for the origin request policy.
|
String |
getAttrLastModifiedTime()
The date and time when the origin request policy was last modified.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getOriginRequestPolicyConfig()
The origin request policy configuration.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setOriginRequestPolicyConfig(CfnOriginRequestPolicy.OriginRequestPolicyConfigProperty value)
The origin request policy configuration.
|
void |
setOriginRequestPolicyConfig(IResolvable value)
The origin request policy configuration.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnOriginRequestPolicy(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnOriginRequestPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnOriginRequestPolicy(@NotNull
Construct scope,
@NotNull
String id,
@NotNull
CfnOriginRequestPolicyProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrId()
For example: befd7079-9bbc-4ebf-8ade-498a3694176c .
@Stability(value=Stable) @NotNull public String getAttrLastModifiedTime()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Object getOriginRequestPolicyConfig()
@Stability(value=Stable)
public void setOriginRequestPolicyConfig(@NotNull
IResolvable value)
@Stability(value=Stable)
public void setOriginRequestPolicyConfig(@NotNull
CfnOriginRequestPolicy.OriginRequestPolicyConfigProperty value)
Copyright © 2022. All rights reserved.