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

com.pulumi.alicloud.ddos.kotlin.SchedulerRuleArgs.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.

There is a newer version: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.ddos.kotlin

import com.pulumi.alicloud.ddos.SchedulerRuleArgs.builder
import com.pulumi.alicloud.ddos.kotlin.inputs.SchedulerRuleRuleArgs
import com.pulumi.alicloud.ddos.kotlin.inputs.SchedulerRuleRuleArgsBuilder
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a DdosCoo Scheduler Rule resource. For information about DdosCoo Scheduler Rule and how to use it, see[What is DdosCoo Scheduler Rule](https://www.alibabacloud.com/help/en/ddos-protection/latest/api-ddoscoo-2020-01-01-createschedulerrule).
 * > **NOTE:** Available since v1.86.0.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const config = new pulumi.Config();
 * const name = config.get("name") || "tf-example";
 * const example = new alicloud.ddos.SchedulerRule("example", {
 *     ruleName: name,
 *     ruleType: 3,
 *     rules: [
 *         {
 *             priority: 100,
 *             regionId: "cn-hangzhou",
 *             type: "A",
 *             value: "127.0.0.1",
 *             valueType: 3,
 *         },
 *         {
 *             priority: 50,
 *             regionId: "cn-hangzhou",
 *             type: "A",
 *             value: "127.0.0.0",
 *             valueType: 1,
 *         },
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * config = pulumi.Config()
 * name = config.get("name")
 * if name is None:
 *     name = "tf-example"
 * example = alicloud.ddos.SchedulerRule("example",
 *     rule_name=name,
 *     rule_type=3,
 *     rules=[
 *         {
 *             "priority": 100,
 *             "region_id": "cn-hangzhou",
 *             "type": "A",
 *             "value": "127.0.0.1",
 *             "value_type": 3,
 *         },
 *         {
 *             "priority": 50,
 *             "region_id": "cn-hangzhou",
 *             "type": "A",
 *             "value": "127.0.0.0",
 *             "value_type": 1,
 *         },
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var config = new Config();
 *     var name = config.Get("name") ?? "tf-example";
 *     var example = new AliCloud.Ddos.SchedulerRule("example", new()
 *     {
 *         RuleName = name,
 *         RuleType = 3,
 *         Rules = new[]
 *         {
 *             new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
 *             {
 *                 Priority = 100,
 *                 RegionId = "cn-hangzhou",
 *                 Type = "A",
 *                 Value = "127.0.0.1",
 *                 ValueType = 3,
 *             },
 *             new AliCloud.Ddos.Inputs.SchedulerRuleRuleArgs
 *             {
 *                 Priority = 50,
 *                 RegionId = "cn-hangzhou",
 *                 Type = "A",
 *                 Value = "127.0.0.0",
 *                 ValueType = 1,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ddos"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		cfg := config.New(ctx, "")
 * 		name := "tf-example"
 * 		if param := cfg.Get("name"); param != "" {
 * 			name = param
 * 		}
 * 		_, err := ddos.NewSchedulerRule(ctx, "example", &ddos.SchedulerRuleArgs{
 * 			RuleName: pulumi.String(name),
 * 			RuleType: pulumi.Int(3),
 * 			Rules: ddos.SchedulerRuleRuleArray{
 * 				&ddos.SchedulerRuleRuleArgs{
 * 					Priority:  pulumi.Int(100),
 * 					RegionId:  pulumi.String("cn-hangzhou"),
 * 					Type:      pulumi.String("A"),
 * 					Value:     pulumi.String("127.0.0.1"),
 * 					ValueType: pulumi.Int(3),
 * 				},
 * 				&ddos.SchedulerRuleRuleArgs{
 * 					Priority:  pulumi.Int(50),
 * 					RegionId:  pulumi.String("cn-hangzhou"),
 * 					Type:      pulumi.String("A"),
 * 					Value:     pulumi.String("127.0.0.0"),
 * 					ValueType: pulumi.Int(1),
 * 				},
 * 			},
 * 		})
 * 		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.alicloud.ddos.SchedulerRule;
 * import com.pulumi.alicloud.ddos.SchedulerRuleArgs;
 * import com.pulumi.alicloud.ddos.inputs.SchedulerRuleRuleArgs;
 * 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 config = ctx.config();
 *         final var name = config.get("name").orElse("tf-example");
 *         var example = new SchedulerRule("example", SchedulerRuleArgs.builder()
 *             .ruleName(name)
 *             .ruleType(3)
 *             .rules(
 *                 SchedulerRuleRuleArgs.builder()
 *                     .priority(100)
 *                     .regionId("cn-hangzhou")
 *                     .type("A")
 *                     .value("127.0.0.1")
 *                     .valueType(3)
 *                     .build(),
 *                 SchedulerRuleRuleArgs.builder()
 *                     .priority(50)
 *                     .regionId("cn-hangzhou")
 *                     .type("A")
 *                     .value("127.0.0.0")
 *                     .valueType(1)
 *                     .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * configuration:
 *   name:
 *     type: string
 *     default: tf-example
 * resources:
 *   example:
 *     type: alicloud:ddos:SchedulerRule
 *     properties:
 *       ruleName: ${name}
 *       ruleType: 3
 *       rules:
 *         - priority: 100
 *           regionId: cn-hangzhou
 *           type: A
 *           value: 127.0.0.1
 *           valueType: 3
 *         - priority: 50
 *           regionId: cn-hangzhou
 *           type: A
 *           value: 127.0.0.0
 *           valueType: 1
 * ```
 * 
 * ## Import
 * DdosCoo Scheduler Rule can be imported using the id or the rule name, e.g.
 * ```sh
 * $ pulumi import alicloud:ddos/schedulerRule:SchedulerRule example fbb20dc77e8fc******
 * ```
 * @property param The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
 * @property resourceGroupId The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
 * @property ruleName The name of the rule.
 * @property ruleType The rule type. Valid values:
 * `2`: tiered protection.
 * `3`: globalization acceleration.
 * `6`: Cloud product interaction.
 * @property rules The information about the scheduling rules. See `rules` below.
 */
public data class SchedulerRuleArgs(
    public val `param`: Output? = null,
    public val resourceGroupId: Output? = null,
    public val ruleName: Output? = null,
    public val ruleType: Output? = null,
    public val rules: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.ddos.SchedulerRuleArgs =
        com.pulumi.alicloud.ddos.SchedulerRuleArgs.builder()
            .`param`(`param`?.applyValue({ args0 -> args0 }))
            .resourceGroupId(resourceGroupId?.applyValue({ args0 -> args0 }))
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .ruleType(ruleType?.applyValue({ args0 -> args0 }))
            .rules(
                rules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [SchedulerRuleArgs].
 */
@PulumiTagMarker
public class SchedulerRuleArgsBuilder internal constructor() {
    private var `param`: Output? = null

    private var resourceGroupId: Output? = null

    private var ruleName: Output? = null

    private var ruleType: Output? = null

    private var rules: Output>? = null

    /**
     * @param value The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
     */
    @JvmName("tftmjfwluetblpfm")
    public suspend fun `param`(`value`: Output) {
        this.`param` = value
    }

    /**
     * @param value The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
     */
    @JvmName("dhjudqleqrvaivyt")
    public suspend fun resourceGroupId(`value`: Output) {
        this.resourceGroupId = value
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("svotaianrhlaurqn")
    public suspend fun ruleName(`value`: Output) {
        this.ruleName = value
    }

    /**
     * @param value The rule type. Valid values:
     * `2`: tiered protection.
     * `3`: globalization acceleration.
     * `6`: Cloud product interaction.
     */
    @JvmName("armmaxbdcuqerkmc")
    public suspend fun ruleType(`value`: Output) {
        this.ruleType = value
    }

    /**
     * @param value The information about the scheduling rules. See `rules` below.
     */
    @JvmName("ncbljnvpvyammpbn")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

    @JvmName("iwepmkijomhaomle")
    public suspend fun rules(vararg values: Output) {
        this.rules = Output.all(values.asList())
    }

    /**
     * @param values The information about the scheduling rules. See `rules` below.
     */
    @JvmName("mcvnpygxxmwwrjej")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value The scheduling rule for the Global Accelerator instance that interacts with Anti-DDoS Pro or Anti-DDoS Premium.
     */
    @JvmName("srhaqoaupvpignow")
    public suspend fun `param`(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`param` = mapped
    }

    /**
     * @param value The ID of the resource group to which the anti-DDoS pro instance belongs in resource management. By default, no value is specified, indicating that the domains in the default resource group are listed.
     */
    @JvmName("cshgquvtgitsitpa")
    public suspend fun resourceGroupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupId = mapped
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("pxjvkybthinfbgaq")
    public suspend fun ruleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleName = mapped
    }

    /**
     * @param value The rule type. Valid values:
     * `2`: tiered protection.
     * `3`: globalization acceleration.
     * `6`: Cloud product interaction.
     */
    @JvmName("ouroxyamgaqshpvw")
    public suspend fun ruleType(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleType = mapped
    }

    /**
     * @param value The information about the scheduling rules. See `rules` below.
     */
    @JvmName("ofxuaulkhudpvast")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument The information about the scheduling rules. See `rules` below.
     */
    @JvmName("losejbkaoakaqsju")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            SchedulerRuleRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument The information about the scheduling rules. See `rules` below.
     */
    @JvmName("yjcqrgiyljtsamjd")
    public suspend fun rules(vararg argument: suspend SchedulerRuleRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            SchedulerRuleRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument The information about the scheduling rules. See `rules` below.
     */
    @JvmName("claxqfuemhdcktqp")
    public suspend fun rules(argument: suspend SchedulerRuleRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SchedulerRuleRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values The information about the scheduling rules. See `rules` below.
     */
    @JvmName("walyhsawklhadyre")
    public suspend fun rules(vararg values: SchedulerRuleRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    internal fun build(): SchedulerRuleArgs = SchedulerRuleArgs(
        `param` = `param`,
        resourceGroupId = resourceGroupId,
        ruleName = ruleName,
        ruleType = ruleType,
        rules = rules,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy