com.pulumi.aws.cloudfront.OriginRequestPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws Show documentation
Show all versions of aws Show documentation
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.aws.cloudfront;
import com.pulumi.aws.Utilities;
import com.pulumi.aws.cloudfront.OriginRequestPolicyArgs;
import com.pulumi.aws.cloudfront.inputs.OriginRequestPolicyState;
import com.pulumi.aws.cloudfront.outputs.OriginRequestPolicyCookiesConfig;
import com.pulumi.aws.cloudfront.outputs.OriginRequestPolicyHeadersConfig;
import com.pulumi.aws.cloudfront.outputs.OriginRequestPolicyQueryStringsConfig;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## Example Usage
*
* The following example below creates a CloudFront origin request policy.
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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()
* .name("example-policy")
* .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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## 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
* ```
*
*/
@ResourceType(type="aws:cloudfront/originRequestPolicy:OriginRequestPolicy")
public class OriginRequestPolicy extends com.pulumi.resources.CustomResource {
/**
* Comment to describe the origin request policy.
*
*/
@Export(name="comment", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> comment;
/**
* @return Comment to describe the origin request policy.
*
*/
public Output> comment() {
return Codegen.optional(this.comment);
}
/**
* 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.
*
*/
@Export(name="cookiesConfig", refs={OriginRequestPolicyCookiesConfig.class}, tree="[0]")
private Output cookiesConfig;
/**
* @return 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.
*
*/
public Output cookiesConfig() {
return this.cookiesConfig;
}
/**
* The current version of the origin request policy.
*
*/
@Export(name="etag", refs={String.class}, tree="[0]")
private Output etag;
/**
* @return The current version of the origin request policy.
*
*/
public Output etag() {
return this.etag;
}
/**
* 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.
*
*/
@Export(name="headersConfig", refs={OriginRequestPolicyHeadersConfig.class}, tree="[0]")
private Output headersConfig;
/**
* @return 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.
*
*/
public Output headersConfig() {
return this.headersConfig;
}
/**
* Unique name to identify the origin request policy.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Unique name to identify the origin request policy.
*
*/
public Output name() {
return this.name;
}
/**
* 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.
*
*/
@Export(name="queryStringsConfig", refs={OriginRequestPolicyQueryStringsConfig.class}, tree="[0]")
private Output queryStringsConfig;
/**
* @return 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.
*
*/
public Output queryStringsConfig() {
return this.queryStringsConfig;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public OriginRequestPolicy(java.lang.String name) {
this(name, OriginRequestPolicyArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public OriginRequestPolicy(java.lang.String name, OriginRequestPolicyArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public OriginRequestPolicy(java.lang.String name, OriginRequestPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:cloudfront/originRequestPolicy:OriginRequestPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private OriginRequestPolicy(java.lang.String name, Output id, @Nullable OriginRequestPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("aws:cloudfront/originRequestPolicy:OriginRequestPolicy", name, state, makeResourceOptions(options, id), false);
}
private static OriginRequestPolicyArgs makeArgs(OriginRequestPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? OriginRequestPolicyArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static OriginRequestPolicy get(java.lang.String name, Output id, @Nullable OriginRequestPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new OriginRequestPolicy(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy