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

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

package com.pulumi.azure.machinelearning.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.Map

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

    public var args: DatastoreFileshareArgs = DatastoreFileshareArgs()

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

/**
 * Manages a Machine Learning File Share DataStore.
 * ## Example Usage
 * ### With Azure File Share
 * 
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.appinsights.Insights;
 * import com.pulumi.azure.appinsights.InsightsArgs;
 * import com.pulumi.azure.keyvault.KeyVault;
 * import com.pulumi.azure.keyvault.KeyVaultArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.machinelearning.Workspace;
 * import com.pulumi.azure.machinelearning.WorkspaceArgs;
 * import com.pulumi.azure.machinelearning.inputs.WorkspaceIdentityArgs;
 * import com.pulumi.azure.storage.Share;
 * import com.pulumi.azure.storage.ShareArgs;
 * import com.pulumi.azure.machinelearning.DatastoreFileshare;
 * import com.pulumi.azure.machinelearning.DatastoreFileshareArgs;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
 *             .name("workspace-example-ai")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationType("web")
 *             .build());
 *         var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
 *             .name("workspaceexamplekeyvault")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .skuName("premium")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("workspacestorageaccount")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .accountTier("Standard")
 *             .accountReplicationType("GRS")
 *             .build());
 *         var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
 *             .name("example-workspace")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationInsightsId(exampleInsights.id())
 *             .keyVaultId(exampleKeyVault.id())
 *             .storageAccountId(exampleAccount.id())
 *             .identity(WorkspaceIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleShare = new Share("exampleShare", ShareArgs.builder()
 *             .name("example")
 *             .storageAccountName(exampleAccount.name())
 *             .quota(1)
 *             .build());
 *         var exampleDatastoreFileshare = new DatastoreFileshare("exampleDatastoreFileshare", DatastoreFileshareArgs.builder()
 *             .name("example-datastore")
 *             .workspaceId(exampleWorkspace.id())
 *             .storageFilesahareId(test.resourceManagerId())
 *             .accountKey(exampleAccount.primaryAccessKey())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleInsights:
 *     type: azure:appinsights:Insights
 *     name: example
 *     properties:
 *       name: workspace-example-ai
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       applicationType: web
 *   exampleKeyVault:
 *     type: azure:keyvault:KeyVault
 *     name: example
 *     properties:
 *       name: workspaceexamplekeyvault
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       tenantId: ${current.tenantId}
 *       skuName: premium
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: workspacestorageaccount
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       accountTier: Standard
 *       accountReplicationType: GRS
 *   exampleWorkspace:
 *     type: azure:machinelearning:Workspace
 *     name: example
 *     properties:
 *       name: example-workspace
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       applicationInsightsId: ${exampleInsights.id}
 *       keyVaultId: ${exampleKeyVault.id}
 *       storageAccountId: ${exampleAccount.id}
 *       identity:
 *         type: SystemAssigned
 *   exampleShare:
 *     type: azure:storage:Share
 *     name: example
 *     properties:
 *       name: example
 *       storageAccountName: ${exampleAccount.name}
 *       quota: 1
 *   exampleDatastoreFileshare:
 *     type: azure:machinelearning:DatastoreFileshare
 *     name: example
 *     properties:
 *       name: example-datastore
 *       workspaceId: ${exampleWorkspace.id}
 *       storageFilesahareId: ${test.resourceManagerId}
 *       accountKey: ${exampleAccount.primaryAccessKey}
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Machine Learning DataStores can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:machinelearning/datastoreFileshare:DatastoreFileshare example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.MachineLearningServices/workspaces/mlw1/dataStores/datastore1
 * ```
 */
public class DatastoreFileshare internal constructor(
    override val javaResource: com.pulumi.azure.machinelearning.DatastoreFileshare,
) : KotlinCustomResource(javaResource, DatastoreFileshareMapper) {
    /**
     * The access key of the Storage Account. Conflicts with `shared_access_signature`.
     */
    public val accountKey: Output?
        get() = javaResource.accountKey().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Text used to describe the asset. Changing this forces a new Machine Learning DataStore to be created.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Indicate whether this Machines Learning DataStore is the default for the Workspace.
     */
    public val isDefault: Output
        get() = javaResource.isDefault().applyValue({ args0 -> args0 })

    /**
     * The name of the Machine Learning DataStore. Changing this forces a new Machine Learning DataStore to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specifies which identity to use when retrieving data from the specified source. Defaults to `None`. Possible values are `None`, `WorkspaceSystemAssignedIdentity` and `WorkspaceUserAssignedIdentity`.
     */
    public val serviceDataIdentity: Output?
        get() = javaResource.serviceDataIdentity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Shared Access Signature of the Storage Account. Conflicts with `account_key`.
     */
    public val sharedAccessSignature: Output?
        get() = javaResource.sharedAccessSignature().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Storage Account File Share. Changing this forces a new Machine Learning DataStore to be created.
     */
    public val storageFileshareId: Output
        get() = javaResource.storageFileshareId().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags which should be assigned to the Machine Learning DataStore. Changing this forces a new Machine Learning DataStore to be created.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning DataStore to be created.
     */
    public val workspaceId: Output
        get() = javaResource.workspaceId().applyValue({ args0 -> args0 })
}

public object DatastoreFileshareMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.machinelearning.DatastoreFileshare::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy