Class: AWSCDK::CloudFront::CfnResponseHeadersPolicy::ResponseHeadersPolicyConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/cfn_response_headers_policy.rb

Overview

A response headers policy configuration.

A response headers policy configuration contains metadata about the response headers policy, and configurations for sets of HTTP response headers.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, comment: nil, cors_config: nil, custom_headers_config: nil, remove_headers_config: nil, security_headers_config: nil, server_timing_headers_config: nil) ⇒ ResponseHeadersPolicyConfigProperty

Returns a new instance of ResponseHeadersPolicyConfigProperty.

Parameters:



1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'cloud_front/cfn_response_headers_policy.rb', line 1137

def initialize(name:, comment: nil, cors_config: nil, custom_headers_config: nil, remove_headers_config: nil, security_headers_config: nil, server_timing_headers_config: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @comment = comment
  Jsii::Type.check_type(@comment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comment") unless @comment.nil?
  @cors_config = cors_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnResponseHeadersPolicy::CorsConfigProperty.new(**cors_config.transform_keys(&:to_sym)) : cors_config
  Jsii::Type.check_type(@cors_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmblJlc3BvbnNlSGVhZGVyc1BvbGljeS5Db3JzQ29uZmlnUHJvcGVydHkifV19fQ==")), "corsConfig") unless @cors_config.nil?
  @custom_headers_config = custom_headers_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnResponseHeadersPolicy::CustomHeadersConfigProperty.new(**custom_headers_config.transform_keys(&:to_sym)) : custom_headers_config
  Jsii::Type.check_type(@custom_headers_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmblJlc3BvbnNlSGVhZGVyc1BvbGljeS5DdXN0b21IZWFkZXJzQ29uZmlnUHJvcGVydHkifV19fQ==")), "customHeadersConfig") unless @custom_headers_config.nil?
  @remove_headers_config = remove_headers_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnResponseHeadersPolicy::RemoveHeadersConfigProperty.new(**remove_headers_config.transform_keys(&:to_sym)) : remove_headers_config
  Jsii::Type.check_type(@remove_headers_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmblJlc3BvbnNlSGVhZGVyc1BvbGljeS5SZW1vdmVIZWFkZXJzQ29uZmlnUHJvcGVydHkifV19fQ==")), "removeHeadersConfig") unless @remove_headers_config.nil?
  @security_headers_config = security_headers_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnResponseHeadersPolicy::SecurityHeadersConfigProperty.new(**security_headers_config.transform_keys(&:to_sym)) : security_headers_config
  Jsii::Type.check_type(@security_headers_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmblJlc3BvbnNlSGVhZGVyc1BvbGljeS5TZWN1cml0eUhlYWRlcnNDb25maWdQcm9wZXJ0eSJ9XX19")), "securityHeadersConfig") unless @security_headers_config.nil?
  @server_timing_headers_config = server_timing_headers_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnResponseHeadersPolicy::ServerTimingHeadersConfigProperty.new(**server_timing_headers_config.transform_keys(&:to_sym)) : server_timing_headers_config
  Jsii::Type.check_type(@server_timing_headers_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmblJlc3BvbnNlSGVhZGVyc1BvbGljeS5TZXJ2ZXJUaW1pbmdIZWFkZXJzQ29uZmlnUHJvcGVydHkifV19fQ==")), "serverTimingHeadersConfig") unless @server_timing_headers_config.nil?
end

Instance Attribute Details

#commentString? (readonly)

A comment to describe the response headers policy.

The comment cannot be longer than 128 characters.



1167
1168
1169
# File 'cloud_front/cfn_response_headers_policy.rb', line 1167

def comment
  @comment
end

#cors_configAWSCDK::IResolvable, ... (readonly)

A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).



1172
1173
1174
# File 'cloud_front/cfn_response_headers_policy.rb', line 1172

def cors_config
  @cors_config
end

#custom_headers_configAWSCDK::IResolvable, ... (readonly)

A configuration for a set of custom HTTP response headers.



1177
1178
1179
# File 'cloud_front/cfn_response_headers_policy.rb', line 1177

def custom_headers_config
  @custom_headers_config
end

#nameString (readonly)

A name to identify the response headers policy.

The name must be unique for response headers policies in this AWS account .



1160
1161
1162
# File 'cloud_front/cfn_response_headers_policy.rb', line 1160

def name
  @name
end

#remove_headers_configAWSCDK::IResolvable, ... (readonly)

A configuration for a set of HTTP headers to remove from the HTTP response.



1182
1183
1184
# File 'cloud_front/cfn_response_headers_policy.rb', line 1182

def remove_headers_config
  @remove_headers_config
end

#security_headers_configAWSCDK::IResolvable, ... (readonly)

A configuration for a set of security-related HTTP response headers.



1187
1188
1189
# File 'cloud_front/cfn_response_headers_policy.rb', line 1187

def security_headers_config
  @security_headers_config
end

#server_timing_headers_configAWSCDK::IResolvable, ... (readonly)

A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront.



1192
1193
1194
# File 'cloud_front/cfn_response_headers_policy.rb', line 1192

def server_timing_headers_config
  @server_timing_headers_config
end

Class Method Details

.jsii_propertiesObject



1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
# File 'cloud_front/cfn_response_headers_policy.rb', line 1194

def self.jsii_properties
  {
    :name => "name",
    :comment => "comment",
    :cors_config => "corsConfig",
    :custom_headers_config => "customHeadersConfig",
    :remove_headers_config => "removeHeadersConfig",
    :security_headers_config => "securityHeadersConfig",
    :server_timing_headers_config => "serverTimingHeadersConfig",
  }
end

Instance Method Details

#to_jsiiObject



1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
# File 'cloud_front/cfn_response_headers_policy.rb', line 1206

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "comment" => @comment,
    "corsConfig" => @cors_config,
    "customHeadersConfig" => @custom_headers_config,
    "removeHeadersConfig" => @remove_headers_config,
    "securityHeadersConfig" => @security_headers_config,
    "serverTimingHeadersConfig" => @server_timing_headers_config,
  })
  result.compact
end