com.pulumi.aws.cloudfront.kotlin.OriginRequestPolicyArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.cloudfront.kotlin
import com.pulumi.aws.cloudfront.OriginRequestPolicyArgs.builder
import com.pulumi.aws.cloudfront.kotlin.inputs.OriginRequestPolicyCookiesConfigArgs
import com.pulumi.aws.cloudfront.kotlin.inputs.OriginRequestPolicyCookiesConfigArgsBuilder
import com.pulumi.aws.cloudfront.kotlin.inputs.OriginRequestPolicyHeadersConfigArgs
import com.pulumi.aws.cloudfront.kotlin.inputs.OriginRequestPolicyHeadersConfigArgsBuilder
import com.pulumi.aws.cloudfront.kotlin.inputs.OriginRequestPolicyQueryStringsConfigArgs
import com.pulumi.aws.cloudfront.kotlin.inputs.OriginRequestPolicyQueryStringsConfigArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* ## Example Usage
* The following example below creates a CloudFront origin request policy.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.cloudfront.OriginRequestPolicy("example", {
* name: "example-policy",
* comment: "example comment",
* cookiesConfig: {
* cookieBehavior: "whitelist",
* cookies: {
* items: ["example"],
* },
* },
* headersConfig: {
* headerBehavior: "whitelist",
* headers: {
* items: ["example"],
* },
* },
* queryStringsConfig: {
* queryStringBehavior: "whitelist",
* queryStrings: {
* items: ["example"],
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.cloudfront.OriginRequestPolicy("example",
* name="example-policy",
* comment="example comment",
* cookies_config={
* "cookie_behavior": "whitelist",
* "cookies": {
* "items": ["example"],
* },
* },
* headers_config={
* "header_behavior": "whitelist",
* "headers": {
* "items": ["example"],
* },
* },
* query_strings_config={
* "query_string_behavior": "whitelist",
* "query_strings": {
* "items": ["example"],
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.CloudFront.OriginRequestPolicy("example", new()
* {
* Name = "example-policy",
* Comment = "example comment",
* CookiesConfig = new Aws.CloudFront.Inputs.OriginRequestPolicyCookiesConfigArgs
* {
* CookieBehavior = "whitelist",
* Cookies = new Aws.CloudFront.Inputs.OriginRequestPolicyCookiesConfigCookiesArgs
* {
* Items = new[]
* {
* "example",
* },
* },
* },
* HeadersConfig = new Aws.CloudFront.Inputs.OriginRequestPolicyHeadersConfigArgs
* {
* HeaderBehavior = "whitelist",
* Headers = new Aws.CloudFront.Inputs.OriginRequestPolicyHeadersConfigHeadersArgs
* {
* Items = new[]
* {
* "example",
* },
* },
* },
* QueryStringsConfig = new Aws.CloudFront.Inputs.OriginRequestPolicyQueryStringsConfigArgs
* {
* QueryStringBehavior = "whitelist",
* QueryStrings = new Aws.CloudFront.Inputs.OriginRequestPolicyQueryStringsConfigQueryStringsArgs
* {
* Items = new[]
* {
* "example",
* },
* },
* },
* });
* });
* ```
* ```go
* 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.NewOriginRequestPolicy(ctx, "example", &cloudfront.OriginRequestPolicyArgs{
* Name: pulumi.String("example-policy"),
* 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
* })
* }
* ```
* ```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()
* .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());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:cloudfront:OriginRequestPolicy
* properties:
* name: example-policy
* comment: example comment
* cookiesConfig:
* cookieBehavior: whitelist
* cookies:
* items:
* - example
* headersConfig:
* headerBehavior: whitelist
* headers:
* items:
* - example
* queryStringsConfig:
* queryStringBehavior: whitelist
* queryStrings:
* items:
* - example
* ```
*
* ## 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
* ```
* @property comment Comment to describe the origin request policy.
* @property cookiesConfig 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.
* @property headersConfig 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.
* @property name Unique name to identify the origin request policy.
* @property queryStringsConfig 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 data class OriginRequestPolicyArgs(
public val comment: Output? = null,
public val cookiesConfig: Output? = null,
public val headersConfig: Output? = null,
public val name: Output? = null,
public val queryStringsConfig: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.cloudfront.OriginRequestPolicyArgs =
com.pulumi.aws.cloudfront.OriginRequestPolicyArgs.builder()
.comment(comment?.applyValue({ args0 -> args0 }))
.cookiesConfig(cookiesConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.headersConfig(headersConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.name(name?.applyValue({ args0 -> args0 }))
.queryStringsConfig(
queryStringsConfig?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
).build()
}
/**
* Builder for [OriginRequestPolicyArgs].
*/
@PulumiTagMarker
public class OriginRequestPolicyArgsBuilder internal constructor() {
private var comment: Output? = null
private var cookiesConfig: Output? = null
private var headersConfig: Output? = null
private var name: Output? = null
private var queryStringsConfig: Output? = null
/**
* @param value Comment to describe the origin request policy.
*/
@JvmName("scdpvhcorvfnnifd")
public suspend fun comment(`value`: Output) {
this.comment = value
}
/**
* @param value 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.
*/
@JvmName("wqnpmklugrhfwuhr")
public suspend fun cookiesConfig(`value`: Output) {
this.cookiesConfig = value
}
/**
* @param value 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.
*/
@JvmName("whnpuassrtbfuefd")
public suspend fun headersConfig(`value`: Output) {
this.headersConfig = value
}
/**
* @param value Unique name to identify the origin request policy.
*/
@JvmName("ajnsqkqlnoumdfrr")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value 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.
*/
@JvmName("ylqthomvskplrwmw")
public suspend fun queryStringsConfig(`value`: Output) {
this.queryStringsConfig = value
}
/**
* @param value Comment to describe the origin request policy.
*/
@JvmName("kisafotrjuekmqwv")
public suspend fun comment(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.comment = mapped
}
/**
* @param value 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.
*/
@JvmName("mvsrxjxavabgcwyn")
public suspend fun cookiesConfig(`value`: OriginRequestPolicyCookiesConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cookiesConfig = mapped
}
/**
* @param argument 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.
*/
@JvmName("uiifqahcodghclsv")
public suspend fun cookiesConfig(argument: suspend OriginRequestPolicyCookiesConfigArgsBuilder.() -> Unit) {
val toBeMapped = OriginRequestPolicyCookiesConfigArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.cookiesConfig = mapped
}
/**
* @param value 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.
*/
@JvmName("qrcjqqvcdinfqnlh")
public suspend fun headersConfig(`value`: OriginRequestPolicyHeadersConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.headersConfig = mapped
}
/**
* @param argument 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.
*/
@JvmName("kwrceltfktipqgym")
public suspend fun headersConfig(argument: suspend OriginRequestPolicyHeadersConfigArgsBuilder.() -> Unit) {
val toBeMapped = OriginRequestPolicyHeadersConfigArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.headersConfig = mapped
}
/**
* @param value Unique name to identify the origin request policy.
*/
@JvmName("bceeasqilqwofhee")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value 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.
*/
@JvmName("dsfmsntoljgwvhjv")
public suspend fun queryStringsConfig(`value`: OriginRequestPolicyQueryStringsConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.queryStringsConfig = mapped
}
/**
* @param argument 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.
*/
@JvmName("gvfmtlqbahjyanib")
public suspend fun queryStringsConfig(argument: suspend OriginRequestPolicyQueryStringsConfigArgsBuilder.() -> Unit) {
val toBeMapped = OriginRequestPolicyQueryStringsConfigArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.queryStringsConfig = mapped
}
internal fun build(): OriginRequestPolicyArgs = OriginRequestPolicyArgs(
comment = comment,
cookiesConfig = cookiesConfig,
headersConfig = headersConfig,
name = name,
queryStringsConfig = queryStringsConfig,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy