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

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

package com.pulumi.azure.network.kotlin

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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: NetworkManagerAdminRuleCollectionArgs = NetworkManagerAdminRuleCollectionArgs()

    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 NetworkManagerAdminRuleCollectionArgsBuilder.() -> Unit) {
        val builder = NetworkManagerAdminRuleCollectionArgsBuilder()
        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(): NetworkManagerAdminRuleCollection {
        val builtJavaResource =
            com.pulumi.azure.network.NetworkManagerAdminRuleCollection(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return NetworkManagerAdminRuleCollection(builtJavaResource)
    }
}

/**
 * Manages a Network Manager Admin Rule Collection.
 * ## 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 current = azure.core.getSubscription({});
 * const exampleNetworkManager = new azure.network.NetworkManager("example", {
 *     name: "example-network-manager",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     scope: {
 *         subscriptionIds: [current.then(current => current.id)],
 *     },
 *     scopeAccesses: [
 *         "Connectivity",
 *         "SecurityAdmin",
 *     ],
 *     description: "example network manager",
 * });
 * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("example", {
 *     name: "example-network-group",
 *     networkManagerId: exampleNetworkManager.id,
 * });
 * const exampleNetworkManagerSecurityAdminConfiguration = new azure.network.NetworkManagerSecurityAdminConfiguration("example", {
 *     name: "example-admin-conf",
 *     networkManagerId: exampleNetworkManager.id,
 * });
 * const exampleNetworkManagerAdminRuleCollection = new azure.network.NetworkManagerAdminRuleCollection("example", {
 *     name: "example-admin-rule-collection",
 *     securityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.id,
 *     networkGroupIds: [exampleNetworkManagerNetworkGroup.id],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * current = azure.core.get_subscription()
 * example_network_manager = azure.network.NetworkManager("example",
 *     name="example-network-manager",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     scope=azure.network.NetworkManagerScopeArgs(
 *         subscription_ids=[current.id],
 *     ),
 *     scope_accesses=[
 *         "Connectivity",
 *         "SecurityAdmin",
 *     ],
 *     description="example network manager")
 * example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("example",
 *     name="example-network-group",
 *     network_manager_id=example_network_manager.id)
 * example_network_manager_security_admin_configuration = azure.network.NetworkManagerSecurityAdminConfiguration("example",
 *     name="example-admin-conf",
 *     network_manager_id=example_network_manager.id)
 * example_network_manager_admin_rule_collection = azure.network.NetworkManagerAdminRuleCollection("example",
 *     name="example-admin-rule-collection",
 *     security_admin_configuration_id=example_network_manager_security_admin_configuration.id,
 *     network_group_ids=[example_network_manager_network_group.id])
 * ```
 * ```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 current = Azure.Core.GetSubscription.Invoke();
 *     var exampleNetworkManager = new Azure.Network.NetworkManager("example", new()
 *     {
 *         Name = "example-network-manager",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs
 *         {
 *             SubscriptionIds = new[]
 *             {
 *                 current.Apply(getSubscriptionResult => getSubscriptionResult.Id),
 *             },
 *         },
 *         ScopeAccesses = new[]
 *         {
 *             "Connectivity",
 *             "SecurityAdmin",
 *         },
 *         Description = "example network manager",
 *     });
 *     var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("example", new()
 *     {
 *         Name = "example-network-group",
 *         NetworkManagerId = exampleNetworkManager.Id,
 *     });
 *     var exampleNetworkManagerSecurityAdminConfiguration = new Azure.Network.NetworkManagerSecurityAdminConfiguration("example", new()
 *     {
 *         Name = "example-admin-conf",
 *         NetworkManagerId = exampleNetworkManager.Id,
 *     });
 *     var exampleNetworkManagerAdminRuleCollection = new Azure.Network.NetworkManagerAdminRuleCollection("example", new()
 *     {
 *         Name = "example-admin-rule-collection",
 *         SecurityAdminConfigurationId = exampleNetworkManagerSecurityAdminConfiguration.Id,
 *         NetworkGroupIds = new[]
 *         {
 *             exampleNetworkManagerNetworkGroup.Id,
 *         },
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		current, err := core.LookupSubscription(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManager, err := network.NewNetworkManager(ctx, "example", &network.NetworkManagerArgs{
 * 			Name:              pulumi.String("example-network-manager"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Scope: &network.NetworkManagerScopeArgs{
 * 				SubscriptionIds: pulumi.StringArray{
 * 					pulumi.String(current.Id),
 * 				},
 * 			},
 * 			ScopeAccesses: pulumi.StringArray{
 * 				pulumi.String("Connectivity"),
 * 				pulumi.String("SecurityAdmin"),
 * 			},
 * 			Description: pulumi.String("example network manager"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "example", &network.NetworkManagerNetworkGroupArgs{
 * 			Name:             pulumi.String("example-network-group"),
 * 			NetworkManagerId: exampleNetworkManager.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManagerSecurityAdminConfiguration, err := network.NewNetworkManagerSecurityAdminConfiguration(ctx, "example", &network.NetworkManagerSecurityAdminConfigurationArgs{
 * 			Name:             pulumi.String("example-admin-conf"),
 * 			NetworkManagerId: exampleNetworkManager.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewNetworkManagerAdminRuleCollection(ctx, "example", &network.NetworkManagerAdminRuleCollectionArgs{
 * 			Name:                         pulumi.String("example-admin-rule-collection"),
 * 			SecurityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.ID(),
 * 			NetworkGroupIds: pulumi.StringArray{
 * 				exampleNetworkManagerNetworkGroup.ID(),
 * 			},
 * 		})
 * 		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.core.CoreFunctions;
 * import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
 * import com.pulumi.azure.network.NetworkManager;
 * import com.pulumi.azure.network.NetworkManagerArgs;
 * import com.pulumi.azure.network.inputs.NetworkManagerScopeArgs;
 * import com.pulumi.azure.network.NetworkManagerNetworkGroup;
 * import com.pulumi.azure.network.NetworkManagerNetworkGroupArgs;
 * import com.pulumi.azure.network.NetworkManagerSecurityAdminConfiguration;
 * import com.pulumi.azure.network.NetworkManagerSecurityAdminConfigurationArgs;
 * import com.pulumi.azure.network.NetworkManagerAdminRuleCollection;
 * import com.pulumi.azure.network.NetworkManagerAdminRuleCollectionArgs;
 * 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());
 *         final var current = CoreFunctions.getSubscription();
 *         var exampleNetworkManager = new NetworkManager("exampleNetworkManager", NetworkManagerArgs.builder()
 *             .name("example-network-manager")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .scope(NetworkManagerScopeArgs.builder()
 *                 .subscriptionIds(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
 *                 .build())
 *             .scopeAccesses(
 *                 "Connectivity",
 *                 "SecurityAdmin")
 *             .description("example network manager")
 *             .build());
 *         var exampleNetworkManagerNetworkGroup = new NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", NetworkManagerNetworkGroupArgs.builder()
 *             .name("example-network-group")
 *             .networkManagerId(exampleNetworkManager.id())
 *             .build());
 *         var exampleNetworkManagerSecurityAdminConfiguration = new NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", NetworkManagerSecurityAdminConfigurationArgs.builder()
 *             .name("example-admin-conf")
 *             .networkManagerId(exampleNetworkManager.id())
 *             .build());
 *         var exampleNetworkManagerAdminRuleCollection = new NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", NetworkManagerAdminRuleCollectionArgs.builder()
 *             .name("example-admin-rule-collection")
 *             .securityAdminConfigurationId(exampleNetworkManagerSecurityAdminConfiguration.id())
 *             .networkGroupIds(exampleNetworkManagerNetworkGroup.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleNetworkManager:
 *     type: azure:network:NetworkManager
 *     name: example
 *     properties:
 *       name: example-network-manager
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       scope:
 *         subscriptionIds:
 *           - ${current.id}
 *       scopeAccesses:
 *         - Connectivity
 *         - SecurityAdmin
 *       description: example network manager
 *   exampleNetworkManagerNetworkGroup:
 *     type: azure:network:NetworkManagerNetworkGroup
 *     name: example
 *     properties:
 *       name: example-network-group
 *       networkManagerId: ${exampleNetworkManager.id}
 *   exampleNetworkManagerSecurityAdminConfiguration:
 *     type: azure:network:NetworkManagerSecurityAdminConfiguration
 *     name: example
 *     properties:
 *       name: example-admin-conf
 *       networkManagerId: ${exampleNetworkManager.id}
 *   exampleNetworkManagerAdminRuleCollection:
 *     type: azure:network:NetworkManagerAdminRuleCollection
 *     name: example
 *     properties:
 *       name: example-admin-rule-collection
 *       securityAdminConfigurationId: ${exampleNetworkManagerSecurityAdminConfiguration.id}
 *       networkGroupIds:
 *         - ${exampleNetworkManagerNetworkGroup.id}
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getSubscription
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Network Manager Admin Rule Collection can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/networkManagerAdminRuleCollection:NetworkManagerAdminRuleCollection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/networkManagers/networkManager1/securityAdminConfigurations/configuration1/ruleCollections/ruleCollection1
 * ```
 */
public class NetworkManagerAdminRuleCollection internal constructor(
    override val javaResource: com.pulumi.azure.network.NetworkManagerAdminRuleCollection,
) : KotlinCustomResource(javaResource, NetworkManagerAdminRuleCollectionMapper) {
    /**
     * A description of the Network Manager Admin Rule Collection.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the name which should be used for this Network Manager Admin Rule Collection. Changing this forces a new Network Manager Admin Rule Collection to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * A list of Network Group ID which this Network Manager Admin Rule Collection applies to.
     */
    public val networkGroupIds: Output>
        get() = javaResource.networkGroupIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Specifies the ID of the Network Manager Security Admin Configuration. Changing this forces a new Network Manager Admin Rule Collection to be created.
     */
    public val securityAdminConfigurationId: Output
        get() = javaResource.securityAdminConfigurationId().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy