Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

AWS Classic

v4.25.0 published on Friday, Oct 15, 2021 by Pulumi

OriginRequestPolicy

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.CloudFront.OriginRequestPolicy("example", new Aws.CloudFront.OriginRequestPolicyArgs
        {
            Comment = "example comment",
            CookiesConfig = new Aws.CloudFront.Inputs.OriginRequestPolicyCookiesConfigArgs
            {
                CookieBehavior = "whitelist",
                Cookies = new Aws.CloudFront.Inputs.OriginRequestPolicyCookiesConfigCookiesArgs
                {
                    Items = 
                    {
                        "example",
                    },
                },
            },
            HeadersConfig = new Aws.CloudFront.Inputs.OriginRequestPolicyHeadersConfigArgs
            {
                HeaderBehavior = "whitelist",
                Headers = new Aws.CloudFront.Inputs.OriginRequestPolicyHeadersConfigHeadersArgs
                {
                    Items = 
                    {
                        "example",
                    },
                },
            },
            QueryStringsConfig = new Aws.CloudFront.Inputs.OriginRequestPolicyQueryStringsConfigArgs
            {
                QueryStringBehavior = "whitelist",
                QueryStrings = new Aws.CloudFront.Inputs.OriginRequestPolicyQueryStringsConfigQueryStringsArgs
                {
                    Items = 
                    {
                        "example",
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewOriginRequestPolicy(ctx, "example", &cloudfront.OriginRequestPolicyArgs{
			Comment: pulumi.String("example comment"),
			CookiesConfig: &cloudfront.OriginRequestPolicyCookiesConfigArgs{
				CookieBehavior: pulumi.String("whitelist"),
				Cookies: &cloudfront.OriginRequestPolicyCookiesConfigCookiesArgs{
					Items: pulumi.StringArray{
						pulumi.String("example"),
					},
				},
			},
			HeadersConfig: &cloudfront.OriginRequestPolicyHeadersConfigArgs{
				HeaderBehavior: pulumi.String("whitelist"),
				Headers: &cloudfront.OriginRequestPolicyHeadersConfigHeadersArgs{
					Items: pulumi.StringArray{
						pulumi.String("example"),
					},
				},
			},
			QueryStringsConfig: &cloudfront.OriginRequestPolicyQueryStringsConfigArgs{
				QueryStringBehavior: pulumi.String("whitelist"),
				QueryStrings: &cloudfront.OriginRequestPolicyQueryStringsConfigQueryStringsArgs{
					Items: pulumi.StringArray{
						pulumi.String("example"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.cloudfront.OriginRequestPolicy("example",
    comment="example comment",
    cookies_config=aws.cloudfront.OriginRequestPolicyCookiesConfigArgs(
        cookie_behavior="whitelist",
        cookies=aws.cloudfront.OriginRequestPolicyCookiesConfigCookiesArgs(
            items=["example"],
        ),
    ),
    headers_config=aws.cloudfront.OriginRequestPolicyHeadersConfigArgs(
        header_behavior="whitelist",
        headers=aws.cloudfront.OriginRequestPolicyHeadersConfigHeadersArgs(
            items=["example"],
        ),
    ),
    query_strings_config=aws.cloudfront.OriginRequestPolicyQueryStringsConfigArgs(
        query_string_behavior="whitelist",
        query_strings=aws.cloudfront.OriginRequestPolicyQueryStringsConfigQueryStringsArgs(
            items=["example"],
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.cloudfront.OriginRequestPolicy("example", {
    comment: "example comment",
    cookiesConfig: {
        cookieBehavior: "whitelist",
        cookies: {
            items: ["example"],
        },
    },
    headersConfig: {
        headerBehavior: "whitelist",
        headers: {
            items: ["example"],
        },
    },
    queryStringsConfig: {
        queryStringBehavior: "whitelist",
        queryStrings: {
            items: ["example"],
        },
    },
});

Create a OriginRequestPolicy Resource

new OriginRequestPolicy(name: string, args: OriginRequestPolicyArgs, opts?: CustomResourceOptions);
@overload
def OriginRequestPolicy(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        comment: Optional[str] = None,
                        cookies_config: Optional[OriginRequestPolicyCookiesConfigArgs] = None,
                        etag: Optional[str] = None,
                        headers_config: Optional[OriginRequestPolicyHeadersConfigArgs] = None,
                        name: Optional[str] = None,
                        query_strings_config: Optional[OriginRequestPolicyQueryStringsConfigArgs] = None)
@overload
def OriginRequestPolicy(resource_name: str,
                        args: OriginRequestPolicyArgs,
                        opts: Optional[ResourceOptions] = None)
func NewOriginRequestPolicy(ctx *Context, name string, args OriginRequestPolicyArgs, opts ...ResourceOption) (*OriginRequestPolicy, error)
public OriginRequestPolicy(string name, OriginRequestPolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args OriginRequestPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args OriginRequestPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args OriginRequestPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args OriginRequestPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

OriginRequestPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The OriginRequestPolicy resource accepts the following input properties:

CookiesConfig OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
HeadersConfig OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
QueryStringsConfig OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
Comment string
Comment to describe the origin request policy.
Etag string
The current version of the origin request policy.
Name string
Unique name to identify the origin request policy.
CookiesConfig OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
HeadersConfig OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
QueryStringsConfig OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
Comment string
Comment to describe the origin request policy.
Etag string
The current version of the origin request policy.
Name string
Unique name to identify the origin request policy.
cookiesConfig OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
headersConfig OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
queryStringsConfig OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
comment string
Comment to describe the origin request policy.
etag string
The current version of the origin request policy.
name string
Unique name to identify the origin request policy.
cookies_config OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
headers_config OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
query_strings_config OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
comment str
Comment to describe the origin request policy.
etag str
The current version of the origin request policy.
name str
Unique name to identify the origin request policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the OriginRequestPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing OriginRequestPolicy Resource

Get an existing OriginRequestPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: OriginRequestPolicyState, opts?: CustomResourceOptions): OriginRequestPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comment: Optional[str] = None,
        cookies_config: Optional[OriginRequestPolicyCookiesConfigArgs] = None,
        etag: Optional[str] = None,
        headers_config: Optional[OriginRequestPolicyHeadersConfigArgs] = None,
        name: Optional[str] = None,
        query_strings_config: Optional[OriginRequestPolicyQueryStringsConfigArgs] = None) -> OriginRequestPolicy
func GetOriginRequestPolicy(ctx *Context, name string, id IDInput, state *OriginRequestPolicyState, opts ...ResourceOption) (*OriginRequestPolicy, error)
public static OriginRequestPolicy Get(string name, Input<string> id, OriginRequestPolicyState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Comment string
Comment to describe the origin request policy.
CookiesConfig OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
Etag string
The current version of the origin request policy.
HeadersConfig OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
Name string
Unique name to identify the origin request policy.
QueryStringsConfig OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
Comment string
Comment to describe the origin request policy.
CookiesConfig OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
Etag string
The current version of the origin request policy.
HeadersConfig OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
Name string
Unique name to identify the origin request policy.
QueryStringsConfig OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
comment string
Comment to describe the origin request policy.
cookiesConfig OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
etag string
The current version of the origin request policy.
headersConfig OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
name string
Unique name to identify the origin request policy.
queryStringsConfig OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.
comment str
Comment to describe the origin request policy.
cookies_config OriginRequestPolicyCookiesConfigArgs
Object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Cookies Config for more information.
etag str
The current version of the origin request policy.
headers_config OriginRequestPolicyHeadersConfigArgs
Object that determines whether any HTTP headers (and if so, which headers) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Headers Config for more information.
name str
Unique name to identify the origin request policy.
query_strings_config OriginRequestPolicyQueryStringsConfigArgs
Object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the origin request key and automatically included in requests that CloudFront sends to the origin. See Query Strings Config for more information.

Supporting Types

OriginRequestPolicyCookiesConfig

OriginRequestPolicyCookiesConfigCookies

Items List<string>
Items []string
items string[]
items Sequence[str]

OriginRequestPolicyHeadersConfig

OriginRequestPolicyHeadersConfigHeaders

Items List<string>
Items []string
items string[]
items Sequence[str]

OriginRequestPolicyQueryStringsConfig

OriginRequestPolicyQueryStringsConfigQueryStrings

Items List<string>
Items []string
items string[]
items Sequence[str]

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.