Package com.pulumi.aws.cloudfront
Class OriginRequestPolicy
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.cloudfront.OriginRequestPolicy
-
public class OriginRequestPolicy extends com.pulumi.resources.CustomResource
## Example Usage The following example below creates a CloudFront origin request policy. ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.cloudfront.OriginRequestPolicy; import com.pulumi.aws.cloudfront.OriginRequestPolicyArgs; import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyCookiesConfigArgs; import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyCookiesConfigCookiesArgs; import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyHeadersConfigArgs; import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyHeadersConfigHeadersArgs; import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyQueryStringsConfigArgs; import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyQueryStringsConfigQueryStringsArgs; 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 OriginRequestPolicy("example", OriginRequestPolicyArgs.builder() .comment("example comment") .cookiesConfig(OriginRequestPolicyCookiesConfigArgs.builder() .cookieBehavior("whitelist") .cookies(OriginRequestPolicyCookiesConfigCookiesArgs.builder() .items("example") .build()) .build()) .headersConfig(OriginRequestPolicyHeadersConfigArgs.builder() .headerBehavior("whitelist") .headers(OriginRequestPolicyHeadersConfigHeadersArgs.builder() .items("example") .build()) .build()) .queryStringsConfig(OriginRequestPolicyQueryStringsConfigArgs.builder() .queryStringBehavior("whitelist") .queryStrings(OriginRequestPolicyQueryStringsConfigQueryStringsArgs.builder() .items("example") .build()) .build()) .build()); } } ``` ## Import Using `pulumi import`, import Cloudfront Origin Request Policies using the `id`. For example: ```sh $ pulumi import aws:cloudfront/originRequestPolicy:OriginRequestPolicy policy ccca32ef-dce3-4df3-80df-1bd3000bc4d3 ```
-
-
Constructor Summary
Constructors Constructor Description OriginRequestPolicy(java.lang.String name)
OriginRequestPolicy(java.lang.String name, OriginRequestPolicyArgs args)
OriginRequestPolicy(java.lang.String name, OriginRequestPolicyArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.Optional<java.lang.String>>
comment()
com.pulumi.core.Output<OriginRequestPolicyCookiesConfig>
cookiesConfig()
com.pulumi.core.Output<java.lang.String>
etag()
static OriginRequestPolicy
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OriginRequestPolicyState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<OriginRequestPolicyHeadersConfig>
headersConfig()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<OriginRequestPolicyQueryStringsConfig>
queryStringsConfig()
-
-
-
Constructor Detail
-
OriginRequestPolicy
public OriginRequestPolicy(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
OriginRequestPolicy
public OriginRequestPolicy(java.lang.String name, OriginRequestPolicyArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
OriginRequestPolicy
public OriginRequestPolicy(java.lang.String name, OriginRequestPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
comment
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> comment()
- Returns:
- Comment to describe the origin request policy.
-
cookiesConfig
public com.pulumi.core.Output<OriginRequestPolicyCookiesConfig> cookiesConfig()
- Returns:
- 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
public com.pulumi.core.Output<java.lang.String> etag()
- Returns:
- The current version of the origin request policy.
-
headersConfig
public com.pulumi.core.Output<OriginRequestPolicyHeadersConfig> headersConfig()
- Returns:
- 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
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Unique name to identify the origin request policy.
-
queryStringsConfig
public com.pulumi.core.Output<OriginRequestPolicyQueryStringsConfig> queryStringsConfig()
- Returns:
- 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.
-
get
public static OriginRequestPolicy get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable OriginRequestPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-