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

com.pulumi.azure.network.kotlin.SubnetServiceEndpointStoragePolicy.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.azure.network.kotlin.outputs.SubnetServiceEndpointStoragePolicyDefinition
import com.pulumi.azure.network.kotlin.outputs.SubnetServiceEndpointStoragePolicyDefinition.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: SubnetServiceEndpointStoragePolicyArgs = SubnetServiceEndpointStoragePolicyArgs()

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

/**
 * Manages a Subnet Service Endpoint Storage Policy.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleSubnetServiceEndpointStoragePolicy = new azure.network.SubnetServiceEndpointStoragePolicy("example", {
 *     name: "example-policy",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     definition: {
 *         name: "name2",
 *         description: "definition2",
 *         service: "Global",
 *         serviceResources: [
 *             "/services/Azure",
 *             "/services/Azure/Batch",
 *             "/services/Azure/DataFactory",
 *             "/services/Azure/MachineLearning",
 *             "/services/Azure/ManagedInstance",
 *             "/services/Azure/WebPI",
 *         ],
 *     },
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplestorageacct",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-rg",
 *     location="West Europe")
 * example_subnet_service_endpoint_storage_policy = azure.network.SubnetServiceEndpointStoragePolicy("example",
 *     name="example-policy",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     definition=azure.network.SubnetServiceEndpointStoragePolicyDefinitionArgs(
 *         name="name2",
 *         description="definition2",
 *         service="Global",
 *         service_resources=[
 *             "/services/Azure",
 *             "/services/Azure/Batch",
 *             "/services/Azure/DataFactory",
 *             "/services/Azure/MachineLearning",
 *             "/services/Azure/ManagedInstance",
 *             "/services/Azure/WebPI",
 *         ],
 *     ))
 * example_account = azure.storage.Account("example",
 *     name="examplestorageacct",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="GRS")
 * ```
 * ```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-rg",
 *         Location = "West Europe",
 *     });
 *     var exampleSubnetServiceEndpointStoragePolicy = new Azure.Network.SubnetServiceEndpointStoragePolicy("example", new()
 *     {
 *         Name = "example-policy",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Definition = new Azure.Network.Inputs.SubnetServiceEndpointStoragePolicyDefinitionArgs
 *         {
 *             Name = "name2",
 *             Description = "definition2",
 *             Service = "Global",
 *             ServiceResources = new[]
 *             {
 *                 "/services/Azure",
 *                 "/services/Azure/Batch",
 *                 "/services/Azure/DataFactory",
 *                 "/services/Azure/MachineLearning",
 *                 "/services/Azure/ManagedInstance",
 *                 "/services/Azure/WebPI",
 *             },
 *         },
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplestorageacct",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "GRS",
 *     });
 * });
 * ```
 * ```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-azure/sdk/v5/go/azure/storage"
 * 	"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-rg"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewSubnetServiceEndpointStoragePolicy(ctx, "example", &network.SubnetServiceEndpointStoragePolicyArgs{
 * 			Name:              pulumi.String("example-policy"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Definition: &network.SubnetServiceEndpointStoragePolicyDefinitionArgs{
 * 				Name:        pulumi.String("name2"),
 * 				Description: pulumi.String("definition2"),
 * 				Service:     pulumi.String("Global"),
 * 				ServiceResources: pulumi.StringArray{
 * 					pulumi.String("/services/Azure"),
 * 					pulumi.String("/services/Azure/Batch"),
 * 					pulumi.String("/services/Azure/DataFactory"),
 * 					pulumi.String("/services/Azure/MachineLearning"),
 * 					pulumi.String("/services/Azure/ManagedInstance"),
 * 					pulumi.String("/services/Azure/WebPI"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplestorageacct"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("GRS"),
 * 		})
 * 		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.SubnetServiceEndpointStoragePolicy;
 * import com.pulumi.azure.network.SubnetServiceEndpointStoragePolicyArgs;
 * import com.pulumi.azure.network.inputs.SubnetServiceEndpointStoragePolicyDefinitionArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * 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-rg")
 *             .location("West Europe")
 *             .build());
 *         var exampleSubnetServiceEndpointStoragePolicy = new SubnetServiceEndpointStoragePolicy("exampleSubnetServiceEndpointStoragePolicy", SubnetServiceEndpointStoragePolicyArgs.builder()
 *             .name("example-policy")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .definition(SubnetServiceEndpointStoragePolicyDefinitionArgs.builder()
 *                 .name("name2")
 *                 .description("definition2")
 *                 .service("Global")
 *                 .serviceResources(
 *                     "/services/Azure",
 *                     "/services/Azure/Batch",
 *                     "/services/Azure/DataFactory",
 *                     "/services/Azure/MachineLearning",
 *                     "/services/Azure/ManagedInstance",
 *                     "/services/Azure/WebPI")
 *                 .build())
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplestorageacct")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("GRS")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-rg
 *       location: West Europe
 *   exampleSubnetServiceEndpointStoragePolicy:
 *     type: azure:network:SubnetServiceEndpointStoragePolicy
 *     name: example
 *     properties:
 *       name: example-policy
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       definition:
 *         name: name2
 *         description: definition2
 *         service: Global
 *         serviceResources:
 *           - /services/Azure
 *           - /services/Azure/Batch
 *           - /services/Azure/DataFactory
 *           - /services/Azure/MachineLearning
 *           - /services/Azure/ManagedInstance
 *           - /services/Azure/WebPI
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplestorageacct
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: GRS
 * ```
 * 
 * ## Import
 * Subnet Service Endpoint Policies can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/subnetServiceEndpointStoragePolicy:SubnetServiceEndpointStoragePolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/serviceEndpointPolicies/policy1
 * ```
 */
public class SubnetServiceEndpointStoragePolicy internal constructor(
    override val javaResource: com.pulumi.azure.network.SubnetServiceEndpointStoragePolicy,
) : KotlinCustomResource(javaResource, SubnetServiceEndpointStoragePolicyMapper) {
    /**
     * A `definition` block as defined below
     */
    public val definition: Output?
        get() = javaResource.definition().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The Azure Region where the Subnet Service Endpoint Storage Policy should exist. Changing this forces a new Subnet Service Endpoint Storage Policy to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this Subnet Service Endpoint Storage Policy. Changing this forces a new Subnet Service Endpoint Storage Policy to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The name of the Resource Group where the Subnet Service Endpoint Storage Policy should exist. Changing this forces a new Subnet Service Endpoint Storage Policy to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the Subnet Service Endpoint Storage Policy.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy