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

com.pulumi.azurenative.dbformysql.kotlin.FirewallRuleArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.dbformysql.kotlin

import com.pulumi.azurenative.dbformysql.FirewallRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Represents a server firewall rule.
 * Azure REST API version: 2022-01-01. Prior API version in Azure Native 1.x: 2017-12-01.
 * Other available API versions: 2017-12-01, 2023-06-01-preview, 2023-06-30, 2023-12-30.
 * ## Example Usage
 * ### Create a firewall rule
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var firewallRule = new AzureNative.DBforMySQL.FirewallRule("firewallRule", new()
 *     {
 *         EndIpAddress = "255.255.255.255",
 *         FirewallRuleName = "rule1",
 *         ResourceGroupName = "TestGroup",
 *         ServerName = "testserver",
 *         StartIpAddress = "0.0.0.0",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	dbformysql "github.com/pulumi/pulumi-azure-native-sdk/dbformysql/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dbformysql.NewFirewallRule(ctx, "firewallRule", &dbformysql.FirewallRuleArgs{
 * 			EndIpAddress:      pulumi.String("255.255.255.255"),
 * 			FirewallRuleName:  pulumi.String("rule1"),
 * 			ResourceGroupName: pulumi.String("TestGroup"),
 * 			ServerName:        pulumi.String("testserver"),
 * 			StartIpAddress:    pulumi.String("0.0.0.0"),
 * 		})
 * 		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.dbformysql.FirewallRule;
 * import com.pulumi.azurenative.dbformysql.FirewallRuleArgs;
 * 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()
 *             .endIpAddress("255.255.255.255")
 *             .firewallRuleName("rule1")
 *             .resourceGroupName("TestGroup")
 *             .serverName("testserver")
 *             .startIpAddress("0.0.0.0")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:dbformysql:FirewallRule rule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/firewallRules/{firewallRuleName}
 * ```
 * @property endIpAddress The end IP address of the server firewall rule. Must be IPv4 format.
 * @property firewallRuleName The name of the server firewall rule.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property serverName The name of the server.
 * @property startIpAddress The start IP address of the server firewall rule. Must be IPv4 format.
 */
public data class FirewallRuleArgs(
    public val endIpAddress: Output? = null,
    public val firewallRuleName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val startIpAddress: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.dbformysql.FirewallRuleArgs =
        com.pulumi.azurenative.dbformysql.FirewallRuleArgs.builder()
            .endIpAddress(endIpAddress?.applyValue({ args0 -> args0 }))
            .firewallRuleName(firewallRuleName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .startIpAddress(startIpAddress?.applyValue({ args0 -> args0 })).build()
}

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

    private var firewallRuleName: Output? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var startIpAddress: Output? = null

    /**
     * @param value The end IP address of the server firewall rule. Must be IPv4 format.
     */
    @JvmName("ulmqukcypjusgwwa")
    public suspend fun endIpAddress(`value`: Output) {
        this.endIpAddress = value
    }

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

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

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

    /**
     * @param value The start IP address of the server firewall rule. Must be IPv4 format.
     */
    @JvmName("rcejradqgmhtgxit")
    public suspend fun startIpAddress(`value`: Output) {
        this.startIpAddress = value
    }

    /**
     * @param value The end IP address of the server firewall rule. Must be IPv4 format.
     */
    @JvmName("eqjmueivngdnaicq")
    public suspend fun endIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endIpAddress = mapped
    }

    /**
     * @param value The name of the server firewall rule.
     */
    @JvmName("guaoyfwqdavkfhat")
    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 resource group. The name is case insensitive.
     */
    @JvmName("eaoupvhipubrurqy")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

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

    /**
     * @param value The start IP address of the server firewall rule. Must be IPv4 format.
     */
    @JvmName("cdnkiawgdrhfqoti")
    public suspend fun startIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startIpAddress = mapped
    }

    internal fun build(): FirewallRuleArgs = FirewallRuleArgs(
        endIpAddress = endIpAddress,
        firewallRuleName = firewallRuleName,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        startIpAddress = startIpAddress,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy