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

com.pulumi.azure.datafactory.kotlin.Factory.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.datafactory.kotlin

import com.pulumi.azure.datafactory.kotlin.outputs.FactoryGithubConfiguration
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryGlobalParameter
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryIdentity
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryVstsConfiguration
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
import kotlin.collections.Map
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryGithubConfiguration.Companion.toKotlin as factoryGithubConfigurationToKotlin
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryGlobalParameter.Companion.toKotlin as factoryGlobalParameterToKotlin
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryIdentity.Companion.toKotlin as factoryIdentityToKotlin
import com.pulumi.azure.datafactory.kotlin.outputs.FactoryVstsConfiguration.Companion.toKotlin as factoryVstsConfigurationToKotlin

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

    public var args: FactoryArgs = FactoryArgs()

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

/**
 * Manages an Azure Data Factory (Version 2).
 * ## 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 exampleFactory = new azure.datafactory.Factory("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_factory = azure.datafactory.Factory("example",
 *     name="example",
 *     location=example.location,
 *     resource_group_name=example.name)
 * ```
 * ```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 exampleFactory = new Azure.DataFactory.Factory("example", new()
 *     {
 *         Name = "example",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory"
 * 	"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
 * 		}
 * 		_, err = datafactory.NewFactory(ctx, "example", &datafactory.FactoryArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		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.datafactory.Factory;
 * import com.pulumi.azure.datafactory.FactoryArgs;
 * 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 exampleFactory = new Factory("exampleFactory", FactoryArgs.builder()
 *             .name("example")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleFactory:
 *     type: azure:datafactory:Factory
 *     name: example
 *     properties:
 *       name: example
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 * ```
 * 
 * ## Import
 * Data Factory can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:datafactory/factory:Factory example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example
 * ```
 */
public class Factory internal constructor(
    override val javaResource: com.pulumi.azure.datafactory.Factory,
) : KotlinCustomResource(javaResource, FactoryMapper) {
    /**
     * Specifies the Azure Key Vault Key ID to be used as the Customer Managed Key (CMK) for double encryption. Required with user assigned identity.
     */
    public val customerManagedKeyId: Output?
        get() = javaResource.customerManagedKeyId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the ID of the user assigned identity associated with the Customer Managed Key. Must be supplied if `customer_managed_key_id` is set.
     */
    public val customerManagedKeyIdentityId: Output?
        get() = javaResource.customerManagedKeyIdentityId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `github_configuration` block as defined below.
     */
    public val githubConfiguration: Output?
        get() = javaResource.githubConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> factoryGithubConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A list of `global_parameter` blocks as defined above.
     */
    public val globalParameters: Output>?
        get() = javaResource.globalParameters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        factoryGlobalParameterToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * An `identity` block as defined below.
     */
    public val identity: Output?
        get() = javaResource.identity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    factoryIdentityToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Is Managed Virtual Network enabled?
     */
    public val managedVirtualNetworkEnabled: Output?
        get() = javaResource.managedVirtualNetworkEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the name of the Data Factory. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Is the Data Factory visible to the public network? Defaults to `true`.
     */
    public val publicNetworkEnabled: Output?
        get() = javaResource.publicNetworkEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the ID of the purview account resource associated with the Data Factory.
     */
    public val purviewId: Output?
        get() = javaResource.purviewId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of the resource group in which to create the Data Factory. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A `vsts_configuration` block as defined below.
     */
    public val vstsConfiguration: Output?
        get() = javaResource.vstsConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> factoryVstsConfigurationToKotlin(args0) })
            }).orElse(null)
        })
}

public object FactoryMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.datafactory.Factory::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy