Class: AWSCDK::CloudFront::CfnOriginRequestPolicy::OriginRequestPolicyConfigProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::CfnOriginRequestPolicy::OriginRequestPolicyConfigProperty
- Defined in:
- cloud_front/cfn_origin_request_policy.rb
Overview
An origin request policy configuration.
This configuration 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:
- The request body and the URL path (without the domain name) from the viewer request.
- The headers that CloudFront automatically includes in every origin request, including
Host,User-Agent, andX-Amz-Cf-Id. - All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.
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 .
Instance Attribute Summary collapse
-
#comment ⇒ String?
readonly
A comment to describe the origin request policy.
-
#cookies_config ⇒ AWSCDK::IResolvable, AWSCDK::CloudFront::CfnOriginRequestPolicy::CookiesConfigProperty
readonly
The cookies from viewer requests to include in origin requests.
-
#headers_config ⇒ AWSCDK::IResolvable, AWSCDK::CloudFront::CfnOriginRequestPolicy::HeadersConfigProperty
readonly
The HTTP headers to include in origin requests.
-
#name ⇒ String
readonly
A unique name to identify the origin request policy.
-
#query_strings_config ⇒ AWSCDK::IResolvable, AWSCDK::CloudFront::CfnOriginRequestPolicy::QueryStringsConfigProperty
readonly
The URL query strings from viewer requests to include in origin requests.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cookies_config:, headers_config:, name:, query_strings_config:, comment: nil) ⇒ OriginRequestPolicyConfigProperty
constructor
A new instance of OriginRequestPolicyConfigProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cookies_config:, headers_config:, name:, query_strings_config:, comment: nil) ⇒ OriginRequestPolicyConfigProperty
Returns a new instance of OriginRequestPolicyConfigProperty.
635 636 637 638 639 640 641 642 643 644 645 646 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 635 def initialize(cookies_config:, headers_config:, name:, query_strings_config:, comment: nil) @cookies_config = .is_a?(Hash) ? ::AWSCDK::CloudFront::CfnOriginRequestPolicy::CookiesConfigProperty.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@cookies_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbk9yaWdpblJlcXVlc3RQb2xpY3kuQ29va2llc0NvbmZpZ1Byb3BlcnR5In1dfX0=")), "cookiesConfig") @headers_config = headers_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnOriginRequestPolicy::HeadersConfigProperty.new(**headers_config.transform_keys(&:to_sym)) : headers_config Jsii::Type.check_type(@headers_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbk9yaWdpblJlcXVlc3RQb2xpY3kuSGVhZGVyc0NvbmZpZ1Byb3BlcnR5In1dfX0=")), "headersConfig") @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") @query_strings_config = query_strings_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnOriginRequestPolicy::QueryStringsConfigProperty.new(**query_strings_config.transform_keys(&:to_sym)) : query_strings_config Jsii::Type.check_type(@query_strings_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbk9yaWdpblJlcXVlc3RQb2xpY3kuUXVlcnlTdHJpbmdzQ29uZmlnUHJvcGVydHkifV19fQ==")), "queryStringsConfig") @comment = comment Jsii::Type.check_type(@comment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comment") unless @comment.nil? end |
Instance Attribute Details
#comment ⇒ String? (readonly)
A comment to describe the origin request policy.
The comment cannot be longer than 128 characters.
676 677 678 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 676 def comment @comment end |
#cookies_config ⇒ AWSCDK::IResolvable, AWSCDK::CloudFront::CfnOriginRequestPolicy::CookiesConfigProperty (readonly)
The cookies from viewer requests to include in origin requests.
652 653 654 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 652 def @cookies_config end |
#headers_config ⇒ AWSCDK::IResolvable, AWSCDK::CloudFront::CfnOriginRequestPolicy::HeadersConfigProperty (readonly)
The HTTP headers to include in origin requests.
These can include headers from viewer requests and additional headers added by CloudFront.
659 660 661 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 659 def headers_config @headers_config end |
#name ⇒ String (readonly)
A unique name to identify the origin request policy.
664 665 666 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 664 def name @name end |
#query_strings_config ⇒ AWSCDK::IResolvable, AWSCDK::CloudFront::CfnOriginRequestPolicy::QueryStringsConfigProperty (readonly)
The URL query strings from viewer requests to include in origin requests.
669 670 671 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 669 def query_strings_config @query_strings_config end |
Class Method Details
.jsii_properties ⇒ Object
678 679 680 681 682 683 684 685 686 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 678 def self.jsii_properties { :cookies_config => "cookiesConfig", :headers_config => "headersConfig", :name => "name", :query_strings_config => "queryStringsConfig", :comment => "comment", } end |
Instance Method Details
#to_jsii ⇒ Object
688 689 690 691 692 693 694 695 696 697 698 |
# File 'cloud_front/cfn_origin_request_policy.rb', line 688 def to_jsii result = {} result.merge!({ "cookiesConfig" => @cookies_config, "headersConfig" => @headers_config, "name" => @name, "queryStringsConfig" => @query_strings_config, "comment" => @comment, }) result.compact end |