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

com.pulumi.alicloud.ddos.kotlin.BgpPolicyArgs.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.BgpPolicyArgs.builder
import com.pulumi.alicloud.ddos.kotlin.inputs.BgpPolicyContentArgs
import com.pulumi.alicloud.ddos.kotlin.inputs.BgpPolicyContentArgsBuilder
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 Ddos Bgp Policy resource.
 * Ddos protection policy.
 * For information about Ddos Bgp Policy and how to use it, see [What is Policy](https://www.alibabacloud.com/help/en/).
 * > **NOTE:** Available since v1.226.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_exampleacc_bgp32594";
 * const policyName = config.get("policyName") || "example_l4_policy";
 * const _default = new alicloud.ddos.BgpPolicy("default", {
 *     content: {
 *         enableDefense: false,
 *         layer4RuleLists: [{
 *             method: "hex",
 *             match: "1",
 *             action: "1",
 *             limited: 0,
 *             conditionLists: [{
 *                 arg: "3C",
 *                 position: 1,
 *                 depth: 2,
 *             }],
 *             name: "11",
 *             priority: 10,
 *         }],
 *     },
 *     type: "l4",
 *     policyName: "tf_exampleacc_bgp32594",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * config = pulumi.Config()
 * name = config.get("name")
 * if name is None:
 *     name = "tf_exampleacc_bgp32594"
 * policy_name = config.get("policyName")
 * if policy_name is None:
 *     policy_name = "example_l4_policy"
 * default = alicloud.ddos.BgpPolicy("default",
 *     content={
 *         "enable_defense": False,
 *         "layer4_rule_lists": [{
 *             "method": "hex",
 *             "match": "1",
 *             "action": "1",
 *             "limited": 0,
 *             "condition_lists": [{
 *                 "arg": "3C",
 *                 "position": 1,
 *                 "depth": 2,
 *             }],
 *             "name": "11",
 *             "priority": 10,
 *         }],
 *     },
 *     type="l4",
 *     policy_name="tf_exampleacc_bgp32594")
 * ```
 * ```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_exampleacc_bgp32594";
 *     var policyName = config.Get("policyName") ?? "example_l4_policy";
 *     var @default = new AliCloud.Ddos.BgpPolicy("default", new()
 *     {
 *         Content = new AliCloud.Ddos.Inputs.BgpPolicyContentArgs
 *         {
 *             EnableDefense = false,
 *             Layer4RuleLists = new[]
 *             {
 *                 new AliCloud.Ddos.Inputs.BgpPolicyContentLayer4RuleListArgs
 *                 {
 *                     Method = "hex",
 *                     Match = "1",
 *                     Action = "1",
 *                     Limited = 0,
 *                     ConditionLists = new[]
 *                     {
 *                         new AliCloud.Ddos.Inputs.BgpPolicyContentLayer4RuleListConditionListArgs
 *                         {
 *                             Arg = "3C",
 *                             Position = 1,
 *                             Depth = 2,
 *                         },
 *                     },
 *                     Name = "11",
 *                     Priority = 10,
 *                 },
 *             },
 *         },
 *         Type = "l4",
 *         PolicyName = "tf_exampleacc_bgp32594",
 *     });
 * });
 * ```
 * ```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_exampleacc_bgp32594"
 * 		if param := cfg.Get("name"); param != "" {
 * 			name = param
 * 		}
 * 		policyName := "example_l4_policy"
 * 		if param := cfg.Get("policyName"); param != "" {
 * 			policyName = param
 * 		}
 * 		_, err := ddos.NewBgpPolicy(ctx, "default", &ddos.BgpPolicyArgs{
 * 			Content: &ddos.BgpPolicyContentArgs{
 * 				EnableDefense: pulumi.Bool(false),
 * 				Layer4RuleLists: ddos.BgpPolicyContentLayer4RuleListArray{
 * 					&ddos.BgpPolicyContentLayer4RuleListArgs{
 * 						Method:  pulumi.String("hex"),
 * 						Match:   pulumi.String("1"),
 * 						Action:  pulumi.String("1"),
 * 						Limited: pulumi.Int(0),
 * 						ConditionLists: ddos.BgpPolicyContentLayer4RuleListConditionListArray{
 * 							&ddos.BgpPolicyContentLayer4RuleListConditionListArgs{
 * 								Arg:      pulumi.String("3C"),
 * 								Position: pulumi.Int(1),
 * 								Depth:    pulumi.Int(2),
 * 							},
 * 						},
 * 						Name:     pulumi.String("11"),
 * 						Priority: pulumi.Int(10),
 * 					},
 * 				},
 * 			},
 * 			Type:       pulumi.String("l4"),
 * 			PolicyName: pulumi.String("tf_exampleacc_bgp32594"),
 * 		})
 * 		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.BgpPolicy;
 * import com.pulumi.alicloud.ddos.BgpPolicyArgs;
 * import com.pulumi.alicloud.ddos.inputs.BgpPolicyContentArgs;
 * 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_exampleacc_bgp32594");
 *         final var policyName = config.get("policyName").orElse("example_l4_policy");
 *         var default_ = new BgpPolicy("default", BgpPolicyArgs.builder()
 *             .content(BgpPolicyContentArgs.builder()
 *                 .enableDefense("false")
 *                 .layer4RuleLists(BgpPolicyContentLayer4RuleListArgs.builder()
 *                     .method("hex")
 *                     .match("1")
 *                     .action("1")
 *                     .limited("0")
 *                     .conditionLists(BgpPolicyContentLayer4RuleListConditionListArgs.builder()
 *                         .arg("3C")
 *                         .position("1")
 *                         .depth("2")
 *                         .build())
 *                     .name("11")
 *                     .priority("10")
 *                     .build())
 *                 .build())
 *             .type("l4")
 *             .policyName("tf_exampleacc_bgp32594")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * configuration:
 *   name:
 *     type: string
 *     default: tf_exampleacc_bgp32594
 *   policyName:
 *     type: string
 *     default: example_l4_policy
 * resources:
 *   default:
 *     type: alicloud:ddos:BgpPolicy
 *     properties:
 *       content:
 *         enableDefense: 'false'
 *         layer4RuleLists:
 *           - method: hex
 *             match: '1'
 *             action: '1'
 *             limited: '0'
 *             conditionLists:
 *               - arg: 3C
 *                 position: '1'
 *                 depth: '2'
 *             name: '11'
 *             priority: '10'
 *       type: l4
 *       policyName: tf_exampleacc_bgp32594
 * ```
 * 
 * ## Import
 * Ddos Bgp Policy can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:ddos/bgpPolicy:BgpPolicy example 
 * ```
 * @property content Configuration Content See `content` below.
 * @property policyName The name of the resource
 * @property type Type
 */
public data class BgpPolicyArgs(
    public val content: Output? = null,
    public val policyName: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.ddos.BgpPolicyArgs =
        com.pulumi.alicloud.ddos.BgpPolicyArgs.builder()
            .content(content?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .policyName(policyName?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [BgpPolicyArgs].
 */
@PulumiTagMarker
public class BgpPolicyArgsBuilder internal constructor() {
    private var content: Output? = null

    private var policyName: Output? = null

    private var type: Output? = null

    /**
     * @param value Configuration Content See `content` below.
     */
    @JvmName("ghfaidlmacihtusk")
    public suspend fun content(`value`: Output) {
        this.content = value
    }

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

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

    /**
     * @param value Configuration Content See `content` below.
     */
    @JvmName("pxxdqbpicdbwicll")
    public suspend fun content(`value`: BgpPolicyContentArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.content = mapped
    }

    /**
     * @param argument Configuration Content See `content` below.
     */
    @JvmName("adxejlvbxpkkldtc")
    public suspend fun content(argument: suspend BgpPolicyContentArgsBuilder.() -> Unit) {
        val toBeMapped = BgpPolicyContentArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.content = mapped
    }

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

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

    internal fun build(): BgpPolicyArgs = BgpPolicyArgs(
        content = content,
        policyName = policyName,
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy