1. Packages
  2. AWS Classic
  3. API Docs
  4. cloudfront
  5. getOriginRequestPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

aws.cloudfront.getOriginRequestPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.cloudfront.getOriginRequestPolicy({
        name: "example-policy",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.get_origin_request_policy(name="example-policy")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.LookupOriginRequestPolicy(ctx, &cloudfront.LookupOriginRequestPolicyArgs{
    			Name: pulumi.StringRef("example-policy"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.CloudFront.GetOriginRequestPolicy.Invoke(new()
        {
            Name = "example-policy",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.CloudfrontFunctions;
    import com.pulumi.aws.cloudfront.inputs.GetOriginRequestPolicyArgs;
    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) {
            final var example = CloudfrontFunctions.getOriginRequestPolicy(GetOriginRequestPolicyArgs.builder()
                .name("example-policy")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:cloudfront:getOriginRequestPolicy
          Arguments:
            name: example-policy
    

    AWS-Managed Policies

    AWS managed origin request policy names are prefixed with Managed-:

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const uaReferer = aws.cloudfront.getOriginRequestPolicy({
        name: "Managed-UserAgentRefererHeaders",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    ua_referer = aws.cloudfront.get_origin_request_policy(name="Managed-UserAgentRefererHeaders")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.LookupOriginRequestPolicy(ctx, &cloudfront.LookupOriginRequestPolicyArgs{
    			Name: pulumi.StringRef("Managed-UserAgentRefererHeaders"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var uaReferer = Aws.CloudFront.GetOriginRequestPolicy.Invoke(new()
        {
            Name = "Managed-UserAgentRefererHeaders",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.CloudfrontFunctions;
    import com.pulumi.aws.cloudfront.inputs.GetOriginRequestPolicyArgs;
    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) {
            final var uaReferer = CloudfrontFunctions.getOriginRequestPolicy(GetOriginRequestPolicyArgs.builder()
                .name("Managed-UserAgentRefererHeaders")
                .build());
    
        }
    }
    
    variables:
      uaReferer:
        fn::invoke:
          Function: aws:cloudfront:getOriginRequestPolicy
          Arguments:
            name: Managed-UserAgentRefererHeaders
    

    Using getOriginRequestPolicy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getOriginRequestPolicy(args: GetOriginRequestPolicyArgs, opts?: InvokeOptions): Promise<GetOriginRequestPolicyResult>
    function getOriginRequestPolicyOutput(args: GetOriginRequestPolicyOutputArgs, opts?: InvokeOptions): Output<GetOriginRequestPolicyResult>
    def get_origin_request_policy(id: Optional[str] = None,
                                  name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetOriginRequestPolicyResult
    def get_origin_request_policy_output(id: Optional[pulumi.Input[str]] = None,
                                  name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetOriginRequestPolicyResult]
    func LookupOriginRequestPolicy(ctx *Context, args *LookupOriginRequestPolicyArgs, opts ...InvokeOption) (*LookupOriginRequestPolicyResult, error)
    func LookupOriginRequestPolicyOutput(ctx *Context, args *LookupOriginRequestPolicyOutputArgs, opts ...InvokeOption) LookupOriginRequestPolicyResultOutput

    > Note: This function is named LookupOriginRequestPolicy in the Go SDK.

    public static class GetOriginRequestPolicy 
    {
        public static Task<GetOriginRequestPolicyResult> InvokeAsync(GetOriginRequestPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetOriginRequestPolicyResult> Invoke(GetOriginRequestPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOriginRequestPolicyResult> getOriginRequestPolicy(GetOriginRequestPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:cloudfront/getOriginRequestPolicy:getOriginRequestPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Identifier for the origin request policy.
    Name string
    Unique name to identify the origin request policy.
    Id string
    Identifier for the origin request policy.
    Name string
    Unique name to identify the origin request policy.
    id String
    Identifier for the origin request policy.
    name String
    Unique name to identify the origin request policy.
    id string
    Identifier for the origin request policy.
    name string
    Unique name to identify the origin request policy.
    id str
    Identifier for the origin request policy.
    name str
    Unique name to identify the origin request policy.
    id String
    Identifier for the origin request policy.
    name String
    Unique name to identify the origin request policy.

    getOriginRequestPolicy Result

    The following output properties are available:

    Comment string
    Comment to describe the origin request policy.
    CookiesConfigs List<GetOriginRequestPolicyCookiesConfig>
    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
    Current version of the origin request policy.
    HeadersConfigs List<GetOriginRequestPolicyHeadersConfig>
    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.
    QueryStringsConfigs List<GetOriginRequestPolicyQueryStringsConfig>
    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 String Config for more information.
    Id string
    Name string
    Comment string
    Comment to describe the origin request policy.
    CookiesConfigs []GetOriginRequestPolicyCookiesConfig
    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
    Current version of the origin request policy.
    HeadersConfigs []GetOriginRequestPolicyHeadersConfig
    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.
    QueryStringsConfigs []GetOriginRequestPolicyQueryStringsConfig
    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 String Config for more information.
    Id string
    Name string
    comment String
    Comment to describe the origin request policy.
    cookiesConfigs List<GetOriginRequestPolicyCookiesConfig>
    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
    Current version of the origin request policy.
    headersConfigs List<GetOriginRequestPolicyHeadersConfig>
    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.
    queryStringsConfigs List<GetOriginRequestPolicyQueryStringsConfig>
    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 String Config for more information.
    id String
    name String
    comment string
    Comment to describe the origin request policy.
    cookiesConfigs GetOriginRequestPolicyCookiesConfig[]
    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
    Current version of the origin request policy.
    headersConfigs GetOriginRequestPolicyHeadersConfig[]
    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.
    queryStringsConfigs GetOriginRequestPolicyQueryStringsConfig[]
    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 String Config for more information.
    id string
    name string
    comment str
    Comment to describe the origin request policy.
    cookies_configs Sequence[GetOriginRequestPolicyCookiesConfig]
    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
    Current version of the origin request policy.
    headers_configs Sequence[GetOriginRequestPolicyHeadersConfig]
    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_configs Sequence[GetOriginRequestPolicyQueryStringsConfig]
    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 String Config for more information.
    id str
    name str
    comment String
    Comment to describe the origin request policy.
    cookiesConfigs List<Property Map>
    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
    Current version of the origin request policy.
    headersConfigs List<Property Map>
    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.
    queryStringsConfigs List<Property Map>
    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 String Config for more information.
    id String
    name String

    Supporting Types

    GetOriginRequestPolicyCookiesConfig

    GetOriginRequestPolicyCookiesConfigCookie

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

    GetOriginRequestPolicyHeadersConfig

    GetOriginRequestPolicyHeadersConfigHeader

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

    GetOriginRequestPolicyQueryStringsConfig

    GetOriginRequestPolicyQueryStringsConfigQueryString

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.27.0 published on Monday, Mar 18, 2024 by Pulumi