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

com.pulumi.azure.postgresql.kotlin.FlexibleServerFirewallRuleArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.postgresql.kotlin

import com.pulumi.azure.postgresql.FlexibleServerFirewallRuleArgs.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

/**
 * Manages a PostgreSQL Flexible Server Firewall Rule.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("example", {
 *     name: "example-psqlflexibleserver",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     version: "12",
 *     administratorLogin: "psqladmin",
 *     administratorPassword: "H@Sh1CoR3!",
 *     storageMb: 32768,
 *     skuName: "GP_Standard_D4s_v3",
 * });
 * const exampleFlexibleServerFirewallRule = new azure.postgresql.FlexibleServerFirewallRule("example", {
 *     name: "example-fw",
 *     serverId: exampleFlexibleServer.id,
 *     startIpAddress: "122.122.0.0",
 *     endIpAddress: "122.122.0.0",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_flexible_server = azure.postgresql.FlexibleServer("example",
 *     name="example-psqlflexibleserver",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     version="12",
 *     administrator_login="psqladmin",
 *     administrator_password="H@Sh1CoR3!",
 *     storage_mb=32768,
 *     sku_name="GP_Standard_D4s_v3")
 * example_flexible_server_firewall_rule = azure.postgresql.FlexibleServerFirewallRule("example",
 *     name="example-fw",
 *     server_id=example_flexible_server.id,
 *     start_ip_address="122.122.0.0",
 *     end_ip_address="122.122.0.0")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("example", new()
 *     {
 *         Name = "example-psqlflexibleserver",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Version = "12",
 *         AdministratorLogin = "psqladmin",
 *         AdministratorPassword = "H@Sh1CoR3!",
 *         StorageMb = 32768,
 *         SkuName = "GP_Standard_D4s_v3",
 *     });
 *     var exampleFlexibleServerFirewallRule = new Azure.PostgreSql.FlexibleServerFirewallRule("example", new()
 *     {
 *         Name = "example-fw",
 *         ServerId = exampleFlexibleServer.Id,
 *         StartIpAddress = "122.122.0.0",
 *         EndIpAddress = "122.122.0.0",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "example", &postgresql.FlexibleServerArgs{
 * 			Name:                  pulumi.String("example-psqlflexibleserver"),
 * 			ResourceGroupName:     example.Name,
 * 			Location:              example.Location,
 * 			Version:               pulumi.String("12"),
 * 			AdministratorLogin:    pulumi.String("psqladmin"),
 * 			AdministratorPassword: pulumi.String("H@Sh1CoR3!"),
 * 			StorageMb:             pulumi.Int(32768),
 * 			SkuName:               pulumi.String("GP_Standard_D4s_v3"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = postgresql.NewFlexibleServerFirewallRule(ctx, "example", &postgresql.FlexibleServerFirewallRuleArgs{
 * 			Name:           pulumi.String("example-fw"),
 * 			ServerId:       exampleFlexibleServer.ID(),
 * 			StartIpAddress: pulumi.String("122.122.0.0"),
 * 			EndIpAddress:   pulumi.String("122.122.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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.postgresql.FlexibleServer;
 * import com.pulumi.azure.postgresql.FlexibleServerArgs;
 * import com.pulumi.azure.postgresql.FlexibleServerFirewallRule;
 * import com.pulumi.azure.postgresql.FlexibleServerFirewallRuleArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleFlexibleServer = new FlexibleServer("exampleFlexibleServer", FlexibleServerArgs.builder()
 *             .name("example-psqlflexibleserver")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .version("12")
 *             .administratorLogin("psqladmin")
 *             .administratorPassword("H@Sh1CoR3!")
 *             .storageMb(32768)
 *             .skuName("GP_Standard_D4s_v3")
 *             .build());
 *         var exampleFlexibleServerFirewallRule = new FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", FlexibleServerFirewallRuleArgs.builder()
 *             .name("example-fw")
 *             .serverId(exampleFlexibleServer.id())
 *             .startIpAddress("122.122.0.0")
 *             .endIpAddress("122.122.0.0")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleFlexibleServer:
 *     type: azure:postgresql:FlexibleServer
 *     name: example
 *     properties:
 *       name: example-psqlflexibleserver
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       version: '12'
 *       administratorLogin: psqladmin
 *       administratorPassword: H@Sh1CoR3!
 *       storageMb: 32768
 *       skuName: GP_Standard_D4s_v3
 *   exampleFlexibleServerFirewallRule:
 *     type: azure:postgresql:FlexibleServerFirewallRule
 *     name: example
 *     properties:
 *       name: example-fw
 *       serverId: ${exampleFlexibleServer.id}
 *       startIpAddress: 122.122.0.0
 *       endIpAddress: 122.122.0.0
 * ```
 * 
 * ## Import
 * PostgreSQL Flexible Server Firewall Rules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:postgresql/flexibleServerFirewallRule:FlexibleServerFirewallRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServer1/firewallRules/firewallRule1
 * ```
 * @property endIpAddress The End IP Address associated with this PostgreSQL Flexible Server Firewall Rule.
 * @property name The name which should be used for this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.
 * @property serverId The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.
 * @property startIpAddress The Start IP Address associated with this PostgreSQL Flexible Server Firewall Rule.
 */
public data class FlexibleServerFirewallRuleArgs(
    public val endIpAddress: Output? = null,
    public val name: Output? = null,
    public val serverId: Output? = null,
    public val startIpAddress: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.postgresql.FlexibleServerFirewallRuleArgs =
        com.pulumi.azure.postgresql.FlexibleServerFirewallRuleArgs.builder()
            .endIpAddress(endIpAddress?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .serverId(serverId?.applyValue({ args0 -> args0 }))
            .startIpAddress(startIpAddress?.applyValue({ args0 -> args0 })).build()
}

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

    private var name: Output? = null

    private var serverId: Output? = null

    private var startIpAddress: Output? = null

    /**
     * @param value The End IP Address associated with this PostgreSQL Flexible Server Firewall Rule.
     */
    @JvmName("fbvmcxpeqldekdfa")
    public suspend fun endIpAddress(`value`: Output) {
        this.endIpAddress = value
    }

    /**
     * @param value The name which should be used for this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.
     */
    @JvmName("normphtqbqgljygj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.
     */
    @JvmName("viyeuamhdfratyil")
    public suspend fun serverId(`value`: Output) {
        this.serverId = value
    }

    /**
     * @param value The Start IP Address associated with this PostgreSQL Flexible Server Firewall Rule.
     */
    @JvmName("cxkmrgmmwfaqugtj")
    public suspend fun startIpAddress(`value`: Output) {
        this.startIpAddress = value
    }

    /**
     * @param value The End IP Address associated with this PostgreSQL Flexible Server Firewall Rule.
     */
    @JvmName("auyogwygrolgifkm")
    public suspend fun endIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endIpAddress = mapped
    }

    /**
     * @param value The name which should be used for this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.
     */
    @JvmName("vhaqgfbhyprhjtvs")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the PostgreSQL Flexible Server from which to create this PostgreSQL Flexible Server Firewall Rule. Changing this forces a new PostgreSQL Flexible Server Firewall Rule to be created.
     */
    @JvmName("yepwletgunyaywjv")
    public suspend fun serverId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverId = mapped
    }

    /**
     * @param value The Start IP Address associated with this PostgreSQL Flexible Server Firewall Rule.
     */
    @JvmName("fqayxtbbvwrbswdq")
    public suspend fun startIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startIpAddress = mapped
    }

    internal fun build(): FlexibleServerFirewallRuleArgs = FlexibleServerFirewallRuleArgs(
        endIpAddress = endIpAddress,
        name = name,
        serverId = serverId,
        startIpAddress = startIpAddress,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy