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

com.pulumi.azure.network.kotlin.VpnServerConfigurationPolicyGroup.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.kotlin.outputs.VpnServerConfigurationPolicyGroupPolicy
import com.pulumi.azure.network.kotlin.outputs.VpnServerConfigurationPolicyGroupPolicy.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [VpnServerConfigurationPolicyGroup].
 */
@PulumiTagMarker
public class VpnServerConfigurationPolicyGroupResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: VpnServerConfigurationPolicyGroupArgs = VpnServerConfigurationPolicyGroupArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend VpnServerConfigurationPolicyGroupArgsBuilder.() -> Unit) {
        val builder = VpnServerConfigurationPolicyGroupArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): VpnServerConfigurationPolicyGroup {
        val builtJavaResource =
            com.pulumi.azure.network.VpnServerConfigurationPolicyGroup(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return VpnServerConfigurationPolicyGroup(builtJavaResource)
    }
}

/**
 * Manages a VPN Server Configuration Policy Group.
 * ## 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 exampleVpnServerConfiguration = new azure.network.VpnServerConfiguration("example", {
 *     name: "example-VPNSC",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     vpnAuthenticationTypes: ["Radius"],
 *     radius: {
 *         servers: [{
 *             address: "10.105.1.1",
 *             secret: "vindicators-the-return-of-worldender",
 *             score: 15,
 *         }],
 *     },
 * });
 * const exampleVpnServerConfigurationPolicyGroup = new azure.network.VpnServerConfigurationPolicyGroup("example", {
 *     name: "example-VPNSCPG",
 *     vpnServerConfigurationId: exampleVpnServerConfiguration.id,
 *     policies: [{
 *         name: "policy1",
 *         type: "RadiusAzureGroupId",
 *         value: "6ad1bd08",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_vpn_server_configuration = azure.network.VpnServerConfiguration("example",
 *     name="example-VPNSC",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     vpn_authentication_types=["Radius"],
 *     radius={
 *         "servers": [{
 *             "address": "10.105.1.1",
 *             "secret": "vindicators-the-return-of-worldender",
 *             "score": 15,
 *         }],
 *     })
 * example_vpn_server_configuration_policy_group = azure.network.VpnServerConfigurationPolicyGroup("example",
 *     name="example-VPNSCPG",
 *     vpn_server_configuration_id=example_vpn_server_configuration.id,
 *     policies=[{
 *         "name": "policy1",
 *         "type": "RadiusAzureGroupId",
 *         "value": "6ad1bd08",
 *     }])
 * ```
 * ```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 exampleVpnServerConfiguration = new Azure.Network.VpnServerConfiguration("example", new()
 *     {
 *         Name = "example-VPNSC",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         VpnAuthenticationTypes = new[]
 *         {
 *             "Radius",
 *         },
 *         Radius = new Azure.Network.Inputs.VpnServerConfigurationRadiusArgs
 *         {
 *             Servers = new[]
 *             {
 *                 new Azure.Network.Inputs.VpnServerConfigurationRadiusServerArgs
 *                 {
 *                     Address = "10.105.1.1",
 *                     Secret = "vindicators-the-return-of-worldender",
 *                     Score = 15,
 *                 },
 *             },
 *         },
 *     });
 *     var exampleVpnServerConfigurationPolicyGroup = new Azure.Network.VpnServerConfigurationPolicyGroup("example", new()
 *     {
 *         Name = "example-VPNSCPG",
 *         VpnServerConfigurationId = exampleVpnServerConfiguration.Id,
 *         Policies = new[]
 *         {
 *             new Azure.Network.Inputs.VpnServerConfigurationPolicyGroupPolicyArgs
 *             {
 *                 Name = "policy1",
 *                 Type = "RadiusAzureGroupId",
 *                 Value = "6ad1bd08",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"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
 * 		}
 * 		exampleVpnServerConfiguration, err := network.NewVpnServerConfiguration(ctx, "example", &network.VpnServerConfigurationArgs{
 * 			Name:              pulumi.String("example-VPNSC"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			VpnAuthenticationTypes: pulumi.StringArray{
 * 				pulumi.String("Radius"),
 * 			},
 * 			Radius: &network.VpnServerConfigurationRadiusArgs{
 * 				Servers: network.VpnServerConfigurationRadiusServerArray{
 * 					&network.VpnServerConfigurationRadiusServerArgs{
 * 						Address: pulumi.String("10.105.1.1"),
 * 						Secret:  pulumi.String("vindicators-the-return-of-worldender"),
 * 						Score:   pulumi.Int(15),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVpnServerConfigurationPolicyGroup(ctx, "example", &network.VpnServerConfigurationPolicyGroupArgs{
 * 			Name:                     pulumi.String("example-VPNSCPG"),
 * 			VpnServerConfigurationId: exampleVpnServerConfiguration.ID(),
 * 			Policies: network.VpnServerConfigurationPolicyGroupPolicyArray{
 * 				&network.VpnServerConfigurationPolicyGroupPolicyArgs{
 * 					Name:  pulumi.String("policy1"),
 * 					Type:  pulumi.String("RadiusAzureGroupId"),
 * 					Value: pulumi.String("6ad1bd08"),
 * 				},
 * 			},
 * 		})
 * 		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.network.VpnServerConfiguration;
 * import com.pulumi.azure.network.VpnServerConfigurationArgs;
 * import com.pulumi.azure.network.inputs.VpnServerConfigurationRadiusArgs;
 * import com.pulumi.azure.network.VpnServerConfigurationPolicyGroup;
 * import com.pulumi.azure.network.VpnServerConfigurationPolicyGroupArgs;
 * import com.pulumi.azure.network.inputs.VpnServerConfigurationPolicyGroupPolicyArgs;
 * 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 exampleVpnServerConfiguration = new VpnServerConfiguration("exampleVpnServerConfiguration", VpnServerConfigurationArgs.builder()
 *             .name("example-VPNSC")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .vpnAuthenticationTypes("Radius")
 *             .radius(VpnServerConfigurationRadiusArgs.builder()
 *                 .servers(VpnServerConfigurationRadiusServerArgs.builder()
 *                     .address("10.105.1.1")
 *                     .secret("vindicators-the-return-of-worldender")
 *                     .score(15)
 *                     .build())
 *                 .build())
 *             .build());
 *         var exampleVpnServerConfigurationPolicyGroup = new VpnServerConfigurationPolicyGroup("exampleVpnServerConfigurationPolicyGroup", VpnServerConfigurationPolicyGroupArgs.builder()
 *             .name("example-VPNSCPG")
 *             .vpnServerConfigurationId(exampleVpnServerConfiguration.id())
 *             .policies(VpnServerConfigurationPolicyGroupPolicyArgs.builder()
 *                 .name("policy1")
 *                 .type("RadiusAzureGroupId")
 *                 .value("6ad1bd08")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleVpnServerConfiguration:
 *     type: azure:network:VpnServerConfiguration
 *     name: example
 *     properties:
 *       name: example-VPNSC
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       vpnAuthenticationTypes:
 *         - Radius
 *       radius:
 *         servers:
 *           - address: 10.105.1.1
 *             secret: vindicators-the-return-of-worldender
 *             score: 15
 *   exampleVpnServerConfigurationPolicyGroup:
 *     type: azure:network:VpnServerConfigurationPolicyGroup
 *     name: example
 *     properties:
 *       name: example-VPNSCPG
 *       vpnServerConfigurationId: ${exampleVpnServerConfiguration.id}
 *       policies:
 *         - name: policy1
 *           type: RadiusAzureGroupId
 *           value: 6ad1bd08
 * ```
 * 
 * ## Import
 * VPN Server Configuration Policy Groups can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/vpnServerConfigurationPolicyGroup:VpnServerConfigurationPolicyGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Network/vpnServerConfigurations/serverConfiguration1/configurationPolicyGroups/configurationPolicyGroup1
 * ```
 */
public class VpnServerConfigurationPolicyGroup internal constructor(
    override val javaResource: com.pulumi.azure.network.VpnServerConfigurationPolicyGroup,
) : KotlinCustomResource(javaResource, VpnServerConfigurationPolicyGroupMapper) {
    /**
     * Is this a default VPN Server Configuration Policy Group? Defaults to `false`. Changing this forces a new resource to be created.
     */
    public val isDefault: Output?
        get() = javaResource.isDefault().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Name which should be used for this VPN Server Configuration Policy Group. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * One or more `policy` blocks as documented below.
     */
    public val policies: Output>
        get() = javaResource.policies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            })
        })

    /**
     * The priority of this VPN Server Configuration Policy Group. Defaults to `0`.
     */
    public val priority: Output?
        get() = javaResource.priority().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID of the VPN Server Configuration that the VPN Server Configuration Policy Group belongs to. Changing this forces a new resource to be created.
     */
    public val vpnServerConfigurationId: Output
        get() = javaResource.vpnServerConfigurationId().applyValue({ args0 -> args0 })
}

public object VpnServerConfigurationPolicyGroupMapper :
    ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.network.VpnServerConfigurationPolicyGroup::class == javaResource::class

    override fun map(javaResource: Resource): VpnServerConfigurationPolicyGroup =
        VpnServerConfigurationPolicyGroup(
            javaResource as
                com.pulumi.azure.network.VpnServerConfigurationPolicyGroup,
        )
}

/**
 * @see [VpnServerConfigurationPolicyGroup].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [VpnServerConfigurationPolicyGroup].
 */
public suspend fun vpnServerConfigurationPolicyGroup(
    name: String,
    block: suspend VpnServerConfigurationPolicyGroupResourceBuilder.() -> Unit,
): VpnServerConfigurationPolicyGroup {
    val builder = VpnServerConfigurationPolicyGroupResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [VpnServerConfigurationPolicyGroup].
 * @param name The _unique_ name of the resulting resource.
 */
public fun vpnServerConfigurationPolicyGroup(name: String): VpnServerConfigurationPolicyGroup {
    val builder = VpnServerConfigurationPolicyGroupResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy