All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.cloudflare.kotlin.ZoneSettingsOverrideArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.ZoneSettingsOverrideArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.ZoneSettingsOverrideSettingsArgs
import com.pulumi.cloudflare.kotlin.inputs.ZoneSettingsOverrideSettingsArgsBuilder
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

/**
 * Provides a resource which customizes Cloudflare zone settings.
 * > You **should not** use this resource to manage every zone setting. This
 *   resource is only intended to override those which you do not want the default.
 *   Attempting to manage all settings will result in problems with the resource
 *   applying in a consistent manner.
 * ## Plan-Dependent Settings
 * Note that some settings are only available on certain plans. Setting an argument
 * for a feature that is not available on the plan configured for the zone will
 * result in an error:
 * ```
 * Error: invalid zone setting "\" (value: \) found - cannot be set as it is read only
 * ```
 * This is true even when setting the argument to its default value. These values
 * should either be omitted or set to `null` for zones with plans that don't
 * support the feature. See the [plan feature matrices](https://www.cloudflare.com/plans/) for details on
 * feature support by plan.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const test = new cloudflare.ZoneSettingsOverride("test", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     settings: {
 *         brotli: "on",
 *         challengeTtl: 2700,
 *         securityLevel: "high",
 *         opportunisticEncryption: "on",
 *         automaticHttpsRewrites: "on",
 *         mirage: "on",
 *         waf: "on",
 *         minify: {
 *             css: "on",
 *             js: "off",
 *             html: "off",
 *         },
 *         securityHeader: {
 *             enabled: true,
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * test = cloudflare.ZoneSettingsOverride("test",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     settings={
 *         "brotli": "on",
 *         "challenge_ttl": 2700,
 *         "security_level": "high",
 *         "opportunistic_encryption": "on",
 *         "automatic_https_rewrites": "on",
 *         "mirage": "on",
 *         "waf": "on",
 *         "minify": {
 *             "css": "on",
 *             "js": "off",
 *             "html": "off",
 *         },
 *         "security_header": {
 *             "enabled": True,
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Cloudflare.ZoneSettingsOverride("test", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Settings = new Cloudflare.Inputs.ZoneSettingsOverrideSettingsArgs
 *         {
 *             Brotli = "on",
 *             ChallengeTtl = 2700,
 *             SecurityLevel = "high",
 *             OpportunisticEncryption = "on",
 *             AutomaticHttpsRewrites = "on",
 *             Mirage = "on",
 *             Waf = "on",
 *             Minify = new Cloudflare.Inputs.ZoneSettingsOverrideSettingsMinifyArgs
 *             {
 *                 Css = "on",
 *                 Js = "off",
 *                 Html = "off",
 *             },
 *             SecurityHeader = new Cloudflare.Inputs.ZoneSettingsOverrideSettingsSecurityHeaderArgs
 *             {
 *                 Enabled = true,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudflare.NewZoneSettingsOverride(ctx, "test", &cloudflare.ZoneSettingsOverrideArgs{
 * 			ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Settings: &cloudflare.ZoneSettingsOverrideSettingsArgs{
 * 				Brotli:                  pulumi.String("on"),
 * 				ChallengeTtl:            pulumi.Int(2700),
 * 				SecurityLevel:           pulumi.String("high"),
 * 				OpportunisticEncryption: pulumi.String("on"),
 * 				AutomaticHttpsRewrites:  pulumi.String("on"),
 * 				Mirage:                  pulumi.String("on"),
 * 				Waf:                     pulumi.String("on"),
 * 				Minify: &cloudflare.ZoneSettingsOverrideSettingsMinifyArgs{
 * 					Css:  pulumi.String("on"),
 * 					Js:   pulumi.String("off"),
 * 					Html: pulumi.String("off"),
 * 				},
 * 				SecurityHeader: &cloudflare.ZoneSettingsOverrideSettingsSecurityHeaderArgs{
 * 					Enabled: pulumi.Bool(true),
 * 				},
 * 			},
 * 		})
 * 		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.cloudflare.ZoneSettingsOverride;
 * import com.pulumi.cloudflare.ZoneSettingsOverrideArgs;
 * import com.pulumi.cloudflare.inputs.ZoneSettingsOverrideSettingsArgs;
 * import com.pulumi.cloudflare.inputs.ZoneSettingsOverrideSettingsMinifyArgs;
 * import com.pulumi.cloudflare.inputs.ZoneSettingsOverrideSettingsSecurityHeaderArgs;
 * 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 test = new ZoneSettingsOverride("test", ZoneSettingsOverrideArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .settings(ZoneSettingsOverrideSettingsArgs.builder()
 *                 .brotli("on")
 *                 .challengeTtl(2700)
 *                 .securityLevel("high")
 *                 .opportunisticEncryption("on")
 *                 .automaticHttpsRewrites("on")
 *                 .mirage("on")
 *                 .waf("on")
 *                 .minify(ZoneSettingsOverrideSettingsMinifyArgs.builder()
 *                     .css("on")
 *                     .js("off")
 *                     .html("off")
 *                     .build())
 *                 .securityHeader(ZoneSettingsOverrideSettingsSecurityHeaderArgs.builder()
 *                     .enabled(true)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: cloudflare:ZoneSettingsOverride
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       settings:
 *         brotli: on
 *         challengeTtl: 2700
 *         securityLevel: high
 *         opportunisticEncryption: on
 *         automaticHttpsRewrites: on
 *         mirage: on
 *         waf: on
 *         minify:
 *           css: on
 *           js: off
 *           html: off
 *         securityHeader:
 *           enabled: true
 * ```
 * 
 * @property settings
 * @property zoneId The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
 */
public data class ZoneSettingsOverrideArgs(
    public val settings: Output? = null,
    public val zoneId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.ZoneSettingsOverrideArgs =
        com.pulumi.cloudflare.ZoneSettingsOverrideArgs.builder()
            .settings(settings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ZoneSettingsOverrideArgs].
 */
@PulumiTagMarker
public class ZoneSettingsOverrideArgsBuilder internal constructor() {
    private var settings: Output? = null

    private var zoneId: Output? = null

    /**
     * @param value
     */
    @JvmName("iqsdtcocjeitjoyl")
    public suspend fun settings(`value`: Output) {
        this.settings = value
    }

    /**
     * @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("fwkjrfgwwxcgtqky")
    public suspend fun zoneId(`value`: Output) {
        this.zoneId = value
    }

    /**
     * @param value
     */
    @JvmName("wcmmxpukjxhgyfwv")
    public suspend fun settings(`value`: ZoneSettingsOverrideSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.settings = mapped
    }

    /**
     * @param argument
     */
    @JvmName("aiikfnpmnsogrbyf")
    public suspend fun settings(argument: suspend ZoneSettingsOverrideSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = ZoneSettingsOverrideSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.settings = mapped
    }

    /**
     * @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("rgsrgyebigfpxwjw")
    public suspend fun zoneId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneId = mapped
    }

    internal fun build(): ZoneSettingsOverrideArgs = ZoneSettingsOverrideArgs(
        settings = settings,
        zoneId = zoneId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy