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

com.pulumi.azurenative.documentdb.kotlin.FirewallRuleArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.documentdb.kotlin

import com.pulumi.azurenative.documentdb.FirewallRuleArgs.builder
import com.pulumi.azurenative.documentdb.kotlin.inputs.FirewallRulePropertiesArgs
import com.pulumi.azurenative.documentdb.kotlin.inputs.FirewallRulePropertiesArgsBuilder
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

/**
 * Represents a mongo cluster firewall rule.
 * Azure REST API version: 2024-03-01-preview.
 * Other available API versions: 2024-06-01-preview, 2024-07-01.
 * ## Example Usage
 * ### Creates a firewall rule on a Mongo Cluster resource.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var firewallRule = new AzureNative.DocumentDB.FirewallRule("firewallRule", new()
 *     {
 *         FirewallRuleName = "rule1",
 *         MongoClusterName = "myMongoCluster",
 *         Properties = new AzureNative.DocumentDB.Inputs.FirewallRulePropertiesArgs
 *         {
 *             EndIpAddress = "255.255.255.255",
 *             StartIpAddress = "0.0.0.0",
 *         },
 *         ResourceGroupName = "TestGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	documentdb "github.com/pulumi/pulumi-azure-native-sdk/documentdb/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := documentdb.NewFirewallRule(ctx, "firewallRule", &documentdb.FirewallRuleArgs{
 * 			FirewallRuleName: pulumi.String("rule1"),
 * 			MongoClusterName: pulumi.String("myMongoCluster"),
 * 			Properties: &documentdb.FirewallRulePropertiesArgs{
 * 				EndIpAddress:   pulumi.String("255.255.255.255"),
 * 				StartIpAddress: pulumi.String("0.0.0.0"),
 * 			},
 * 			ResourceGroupName: pulumi.String("TestGroup"),
 * 		})
 * 		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.azurenative.documentdb.FirewallRule;
 * import com.pulumi.azurenative.documentdb.FirewallRuleArgs;
 * import com.pulumi.azurenative.documentdb.inputs.FirewallRulePropertiesArgs;
 * 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 firewallRule = new FirewallRule("firewallRule", FirewallRuleArgs.builder()
 *             .firewallRuleName("rule1")
 *             .mongoClusterName("myMongoCluster")
 *             .properties(FirewallRulePropertiesArgs.builder()
 *                 .endIpAddress("255.255.255.255")
 *                 .startIpAddress("0.0.0.0")
 *                 .build())
 *             .resourceGroupName("TestGroup")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:documentdb:FirewallRule rule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}
 * ```
 * @property firewallRuleName The name of the mongo cluster firewall rule.
 * @property mongoClusterName The name of the mongo cluster.
 * @property properties The resource-specific properties for this resource.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 */
public data class FirewallRuleArgs(
    public val firewallRuleName: Output? = null,
    public val mongoClusterName: Output? = null,
    public val properties: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.documentdb.FirewallRuleArgs =
        com.pulumi.azurenative.documentdb.FirewallRuleArgs.builder()
            .firewallRuleName(firewallRuleName?.applyValue({ args0 -> args0 }))
            .mongoClusterName(mongoClusterName?.applyValue({ args0 -> args0 }))
            .properties(properties?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [FirewallRuleArgs].
 */
@PulumiTagMarker
public class FirewallRuleArgsBuilder internal constructor() {
    private var firewallRuleName: Output? = null

    private var mongoClusterName: Output? = null

    private var properties: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The name of the mongo cluster firewall rule.
     */
    @JvmName("mprtvxveavqnxcdc")
    public suspend fun firewallRuleName(`value`: Output) {
        this.firewallRuleName = value
    }

    /**
     * @param value The name of the mongo cluster.
     */
    @JvmName("euwxcasidyifpqjy")
    public suspend fun mongoClusterName(`value`: Output) {
        this.mongoClusterName = value
    }

    /**
     * @param value The resource-specific properties for this resource.
     */
    @JvmName("nqbfntletthhjdgm")
    public suspend fun properties(`value`: Output) {
        this.properties = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("jugkbyudgxcrvrfq")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

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

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

    /**
     * @param value The resource-specific properties for this resource.
     */
    @JvmName("vpxqsnyghshgdanb")
    public suspend fun properties(`value`: FirewallRulePropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param argument The resource-specific properties for this resource.
     */
    @JvmName("wykcgskvjnnpabky")
    public suspend fun properties(argument: suspend FirewallRulePropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = FirewallRulePropertiesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.properties = mapped
    }

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

    internal fun build(): FirewallRuleArgs = FirewallRuleArgs(
        firewallRuleName = firewallRuleName,
        mongoClusterName = mongoClusterName,
        properties = properties,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy