Class: AWSCDK::CloudFront::OriginRequestHeaderBehavior
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::CloudFront::OriginRequestHeaderBehavior
- Defined in:
- cloud_front/origin_request_header_behavior.rb
Overview
Determines whether any HTTP headers (and if so, which headers) are included in requests that CloudFront sends to the origin.
Class Method Summary collapse
-
.all(*cloudfront_headers) ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.
-
.allow_list(*headers) ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
Listed headers are included in requests that CloudFront sends to the origin.
-
.deny_list(*headers) ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
All headers except the provided
headersare included in requests that CloudFront sends to the origin. - .jsii_overridable_methods ⇒ Object
-
.none ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
HTTP headers are not included in requests that CloudFront sends to the origin.
Instance Method Summary collapse
-
#behavior ⇒ String
The behavior of headers: allow all, none or an allow list.
-
#headers ⇒ Array<String>?
The headers for the allow list or the included CloudFront headers, if applicable.
-
#initialize(*args) ⇒ OriginRequestHeaderBehavior
constructor
A new instance of OriginRequestHeaderBehavior.
Constructor Details
#initialize(*args) ⇒ OriginRequestHeaderBehavior
Returns a new instance of OriginRequestHeaderBehavior.
8 9 10 |
# File 'cloud_front/origin_request_header_behavior.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_cloudfront.OriginRequestHeaderBehavior does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.all(*cloudfront_headers) ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.
Additionally, any additional CloudFront headers provided are included; the additional headers are added by CloudFront.
26 27 28 29 30 31 |
# File 'cloud_front/origin_request_header_behavior.rb', line 26 def self.all(*cloudfront_headers) cloudfront_headers.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cloudfrontHeaders[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.OriginRequestHeaderBehavior", "all", [*cloudfront_headers]) end |
.allow_list(*headers) ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
Listed headers are included in requests that CloudFront sends to the origin.
37 38 39 40 41 42 |
# File 'cloud_front/origin_request_header_behavior.rb', line 37 def self.allow_list(*headers) headers.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "headers[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.OriginRequestHeaderBehavior", "allowList", [*headers]) end |
.deny_list(*headers) ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
All headers except the provided headers are included in requests that CloudFront sends to the origin.
48 49 50 51 52 53 |
# File 'cloud_front/origin_request_header_behavior.rb', line 48 def self.deny_list(*headers) headers.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "headers[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.OriginRequestHeaderBehavior", "denyList", [*headers]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 |
# File 'cloud_front/origin_request_header_behavior.rb', line 12 def self.jsii_overridable_methods { :behavior => { kind: :property, name: "behavior", is_optional: false }, :headers => { kind: :property, name: "headers", is_optional: true }, } end |
.none ⇒ AWSCDK::CloudFront::OriginRequestHeaderBehavior
HTTP headers are not included in requests that CloudFront sends to the origin.
Any headers that are listed in a CachePolicy are still included in origin requests.
60 61 62 |
# File 'cloud_front/origin_request_header_behavior.rb', line 60 def self.none() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.OriginRequestHeaderBehavior", "none", []) end |
Instance Method Details
#behavior ⇒ String
The behavior of headers: allow all, none or an allow list.
67 68 69 |
# File 'cloud_front/origin_request_header_behavior.rb', line 67 def behavior() jsii_get_property("behavior") end |
#headers ⇒ Array<String>?
The headers for the allow list or the included CloudFront headers, if applicable.
74 75 76 |
# File 'cloud_front/origin_request_header_behavior.rb', line 74 def headers() jsii_get_property("headers") end |