ResponseHeadersPolicyArgs

data class ResponseHeadersPolicyArgs(val comment: Output<String>? = null, val corsConfig: Output<ResponseHeadersPolicyCorsConfigArgs>? = null, val customHeadersConfig: Output<ResponseHeadersPolicyCustomHeadersConfigArgs>? = null, val etag: Output<String>? = null, val name: Output<String>? = null, val removeHeadersConfig: Output<ResponseHeadersPolicyRemoveHeadersConfigArgs>? = null, val securityHeadersConfig: Output<ResponseHeadersPolicySecurityHeadersConfigArgs>? = null, val serverTimingHeadersConfig: Output<ResponseHeadersPolicyServerTimingHeadersConfigArgs>? = null) : ConvertibleToJava<ResponseHeadersPolicyArgs>

Provides a CloudFront response headers policy resource. A response headers policy contains information about a set of HTTP response headers and their values. 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, CloudFront adds the headers in the policy to every response that it sends for requests that match the cache behavior.

Example Usage

The example below creates a CloudFront response headers policy.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudfront.ResponseHeadersPolicy;
import com.pulumi.aws.cloudfront.ResponseHeadersPolicyArgs;
import com.pulumi.aws.cloudfront.inputs.ResponseHeadersPolicyCorsConfigArgs;
import com.pulumi.aws.cloudfront.inputs.ResponseHeadersPolicyCorsConfigAccessControlAllowHeadersArgs;
import com.pulumi.aws.cloudfront.inputs.ResponseHeadersPolicyCorsConfigAccessControlAllowMethodsArgs;
import com.pulumi.aws.cloudfront.inputs.ResponseHeadersPolicyCorsConfigAccessControlAllowOriginsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResponseHeadersPolicy("example", ResponseHeadersPolicyArgs.builder()
.comment("test comment")
.corsConfig(ResponseHeadersPolicyCorsConfigArgs.builder()
.accessControlAllowCredentials(true)
.accessControlAllowHeaders(ResponseHeadersPolicyCorsConfigAccessControlAllowHeadersArgs.builder()
.items("test")
.build())
.accessControlAllowMethods(ResponseHeadersPolicyCorsConfigAccessControlAllowMethodsArgs.builder()
.items("GET")
.build())
.accessControlAllowOrigins(ResponseHeadersPolicyCorsConfigAccessControlAllowOriginsArgs.builder()
.items("test.example.comtest")
.build())
.originOverride(true)
.build())
.build());
}
}

Import

Cloudfront Response Headers Policies can be imported using the id, e.g.

$ pulumi import aws:cloudfront/responseHeadersPolicy:ResponseHeadersPolicy policy 658327ea-f89d-4fab-a63d-7e88639e58f9

Constructors

Link copied to clipboard
constructor(comment: Output<String>? = null, corsConfig: Output<ResponseHeadersPolicyCorsConfigArgs>? = null, customHeadersConfig: Output<ResponseHeadersPolicyCustomHeadersConfigArgs>? = null, etag: Output<String>? = null, name: Output<String>? = null, removeHeadersConfig: Output<ResponseHeadersPolicyRemoveHeadersConfigArgs>? = null, securityHeadersConfig: Output<ResponseHeadersPolicySecurityHeadersConfigArgs>? = null, serverTimingHeadersConfig: Output<ResponseHeadersPolicyServerTimingHeadersConfigArgs>? = null)

Properties

Link copied to clipboard
val comment: Output<String>? = null

A comment to describe the response headers policy. The comment cannot be longer than 128 characters.

Link copied to clipboard

A configuration for a set of HTTP response headers that are used for Cross-Origin Resource Sharing (CORS). See Cors Config for more information.

Link copied to clipboard

Object that contains an attribute items that contains a list of custom headers. See Custom Header for more information.

Link copied to clipboard
val etag: Output<String>? = null

The current version of the response headers policy.

Link copied to clipboard
val name: Output<String>? = null

A unique name to identify the response headers policy.

Link copied to clipboard

A configuration for a set of HTTP headers to remove from the HTTP response. Object that contains an attribute items that contains a list of headers. See Remove Header for more information.

Link copied to clipboard

A configuration for a set of security-related HTTP response headers. See Security Headers Config for more information.

Link copied to clipboard

A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront. See Server Timing Headers Config for more information.

Functions

Link copied to clipboard
open override fun toJava(): ResponseHeadersPolicyArgs