Class CfnResponseHeadersPolicy
A response headers policy.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnResponseHeadersPolicy : CfnResource, IInspectable
Syntax (vb)
Public Class CfnResponseHeadersPolicy
Inherits CfnResource
Implements IInspectable
Remarks
A response headers policy contains information about a set of HTTP response headers.
After you create a response headers policy, you can use its ID to attach it to one or more cache behaviors in a CloudFront distribution. When it's attached to a cache behavior, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.
For more information, see Adding or removing HTTP headers in CloudFront responses in the Amazon CloudFront Developer Guide .
CloudformationResource: AWS::CloudFront::ResponseHeadersPolicy
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;
var cfnResponseHeadersPolicy = new CfnResponseHeadersPolicy(this, "MyCfnResponseHeadersPolicy", new CfnResponseHeadersPolicyProps {
ResponseHeadersPolicyConfig = new ResponseHeadersPolicyConfigProperty {
Name = "name",
// the properties below are optional
Comment = "comment",
CorsConfig = new CorsConfigProperty {
AccessControlAllowCredentials = false,
AccessControlAllowHeaders = new AccessControlAllowHeadersProperty {
Items = new [] { "items" }
},
AccessControlAllowMethods = new AccessControlAllowMethodsProperty {
Items = new [] { "items" }
},
AccessControlAllowOrigins = new AccessControlAllowOriginsProperty {
Items = new [] { "items" }
},
OriginOverride = false,
// the properties below are optional
AccessControlExposeHeaders = new AccessControlExposeHeadersProperty {
Items = new [] { "items" }
},
AccessControlMaxAgeSec = 123
},
CustomHeadersConfig = new CustomHeadersConfigProperty {
Items = new [] { new CustomHeaderProperty {
Header = "header",
Override = false,
Value = "value"
} }
},
RemoveHeadersConfig = new RemoveHeadersConfigProperty {
Items = new [] { new RemoveHeaderProperty {
Header = "header"
} }
},
SecurityHeadersConfig = new SecurityHeadersConfigProperty {
ContentSecurityPolicy = new ContentSecurityPolicyProperty {
ContentSecurityPolicy = "contentSecurityPolicy",
Override = false
},
ContentTypeOptions = new ContentTypeOptionsProperty {
Override = false
},
FrameOptions = new FrameOptionsProperty {
FrameOption = "frameOption",
Override = false
},
ReferrerPolicy = new ReferrerPolicyProperty {
Override = false,
ReferrerPolicy = "referrerPolicy"
},
StrictTransportSecurity = new StrictTransportSecurityProperty {
AccessControlMaxAgeSec = 123,
Override = false,
// the properties below are optional
IncludeSubdomains = false,
Preload = false
},
XssProtection = new XSSProtectionProperty {
Override = false,
Protection = false,
// the properties below are optional
ModeBlock = false,
ReportUri = "reportUri"
}
},
ServerTimingHeadersConfig = new ServerTimingHeadersConfigProperty {
Enabled = false,
// the properties below are optional
SamplingRate = 123
}
}
});
Synopsis
Constructors
CfnResponseHeadersPolicy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnResponseHeadersPolicy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnResponseHeadersPolicy(Construct, String, ICfnResponseHeadersPolicyProps) |
Properties
AttrId | The unique identifier for the response headers policy. |
AttrLastModifiedTime | The date and time when the response headers policy was last modified. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ResponseHeadersPolicyConfig | A response headers policy configuration. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnResponseHeadersPolicy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnResponseHeadersPolicy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnResponseHeadersPolicy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnResponseHeadersPolicy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnResponseHeadersPolicy(Construct, String, ICfnResponseHeadersPolicyProps)
public CfnResponseHeadersPolicy(Construct scope, string id, ICfnResponseHeadersPolicyProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnResponseHeadersPolicyProps
Resource properties.
Properties
AttrId
The unique identifier for the response headers policy.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
For example: 57f99797-3b20-4e1b-a728-27972a74082a
.
CloudformationAttribute: Id
AttrLastModifiedTime
The date and time when the response headers policy was last modified.
public virtual string AttrLastModifiedTime { get; }
Property Value
System.String
Remarks
CloudformationAttribute: LastModifiedTime
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ResponseHeadersPolicyConfig
A response headers policy configuration.
public virtual object ResponseHeadersPolicyConfig { get; set; }
Property Value
System.Object
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>