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

com.pulumi.azure.streamanalytics.kotlin.OutputFunctionArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.streamanalytics.kotlin

import com.pulumi.azure.streamanalytics.OutputFunctionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Stream Analytics Output Function.
 * ## 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 exampleAccount = new azure.storage.Account("example", {
 *     name: "examplestorageaccount",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const examplePlan = new azure.appservice.Plan("example", {
 *     name: "exampleappserviceplan",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     kind: "FunctionApp",
 *     reserved: true,
 *     sku: {
 *         tier: "Dynamic",
 *         size: "Y1",
 *     },
 * });
 * const exampleFunctionApp = new azure.appservice.FunctionApp("example", {
 *     name: "examplefunctionapp",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     appServicePlanId: examplePlan.id,
 *     storageAccountName: exampleAccount.name,
 *     storageAccountAccessKey: exampleAccount.primaryAccessKey,
 *     osType: "linux",
 *     version: "~3",
 * });
 * const exampleJob = new azure.streamanalytics.Job("example", {
 *     name: "examplestreamanalyticsjob",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     streamingUnits: 3,
 *     transformationQuery: `    SELECT *
 *     INTO [YourOutputAlias]
 *     FROM [YourInputAlias]
 * `,
 * });
 * const exampleOutputFunction = new azure.streamanalytics.OutputFunction("example", {
 *     name: "exampleoutput",
 *     resourceGroupName: exampleJob.resourceGroupName,
 *     streamAnalyticsJobName: exampleJob.name,
 *     functionApp: exampleFunctionApp.name,
 *     functionName: "examplefunctionname",
 *     apiKey: "exampleapikey",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_account = azure.storage.Account("example",
 *     name="examplestorageaccount",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="LRS")
 * example_plan = azure.appservice.Plan("example",
 *     name="exampleappserviceplan",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     kind="FunctionApp",
 *     reserved=True,
 *     sku={
 *         "tier": "Dynamic",
 *         "size": "Y1",
 *     })
 * example_function_app = azure.appservice.FunctionApp("example",
 *     name="examplefunctionapp",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     app_service_plan_id=example_plan.id,
 *     storage_account_name=example_account.name,
 *     storage_account_access_key=example_account.primary_access_key,
 *     os_type="linux",
 *     version="~3")
 * example_job = azure.streamanalytics.Job("example",
 *     name="examplestreamanalyticsjob",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     streaming_units=3,
 *     transformation_query="""    SELECT *
 *     INTO [YourOutputAlias]
 *     FROM [YourInputAlias]
 * """)
 * example_output_function = azure.streamanalytics.OutputFunction("example",
 *     name="exampleoutput",
 *     resource_group_name=example_job.resource_group_name,
 *     stream_analytics_job_name=example_job.name,
 *     function_app=example_function_app.name,
 *     function_name="examplefunctionname",
 *     api_key="exampleapikey")
 * ```
 * ```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 exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplestorageaccount",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "LRS",
 *     });
 *     var examplePlan = new Azure.AppService.Plan("example", new()
 *     {
 *         Name = "exampleappserviceplan",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Kind = "FunctionApp",
 *         Reserved = true,
 *         Sku = new Azure.AppService.Inputs.PlanSkuArgs
 *         {
 *             Tier = "Dynamic",
 *             Size = "Y1",
 *         },
 *     });
 *     var exampleFunctionApp = new Azure.AppService.FunctionApp("example", new()
 *     {
 *         Name = "examplefunctionapp",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AppServicePlanId = examplePlan.Id,
 *         StorageAccountName = exampleAccount.Name,
 *         StorageAccountAccessKey = exampleAccount.PrimaryAccessKey,
 *         OsType = "linux",
 *         Version = "~3",
 *     });
 *     var exampleJob = new Azure.StreamAnalytics.Job("example", new()
 *     {
 *         Name = "examplestreamanalyticsjob",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         StreamingUnits = 3,
 *         TransformationQuery = @"    SELECT *
 *     INTO [YourOutputAlias]
 *     FROM [YourInputAlias]
 * ",
 *     });
 *     var exampleOutputFunction = new Azure.StreamAnalytics.OutputFunction("example", new()
 *     {
 *         Name = "exampleoutput",
 *         ResourceGroupName = exampleJob.ResourceGroupName,
 *         StreamAnalyticsJobName = exampleJob.Name,
 *         FunctionApp = exampleFunctionApp.Name,
 *         FunctionName = "examplefunctionname",
 *         ApiKey = "exampleapikey",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics"
 * 	"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
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplestorageaccount"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("LRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
 * 			Name:              pulumi.String("exampleappserviceplan"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Kind:              pulumi.Any("FunctionApp"),
 * 			Reserved:          pulumi.Bool(true),
 * 			Sku: &appservice.PlanSkuArgs{
 * 				Tier: pulumi.String("Dynamic"),
 * 				Size: pulumi.String("Y1"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleFunctionApp, err := appservice.NewFunctionApp(ctx, "example", &appservice.FunctionAppArgs{
 * 			Name:                    pulumi.String("examplefunctionapp"),
 * 			Location:                example.Location,
 * 			ResourceGroupName:       example.Name,
 * 			AppServicePlanId:        examplePlan.ID(),
 * 			StorageAccountName:      exampleAccount.Name,
 * 			StorageAccountAccessKey: exampleAccount.PrimaryAccessKey,
 * 			OsType:                  pulumi.String("linux"),
 * 			Version:                 pulumi.String("~3"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleJob, err := streamanalytics.NewJob(ctx, "example", &streamanalytics.JobArgs{
 * 			Name:                pulumi.String("examplestreamanalyticsjob"),
 * 			ResourceGroupName:   example.Name,
 * 			Location:            example.Location,
 * 			StreamingUnits:      pulumi.Int(3),
 * 			TransformationQuery: pulumi.String("    SELECT *\n    INTO [YourOutputAlias]\n    FROM [YourInputAlias]\n"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = streamanalytics.NewOutputFunction(ctx, "example", &streamanalytics.OutputFunctionArgs{
 * 			Name:                   pulumi.String("exampleoutput"),
 * 			ResourceGroupName:      exampleJob.ResourceGroupName,
 * 			StreamAnalyticsJobName: exampleJob.Name,
 * 			FunctionApp:            exampleFunctionApp.Name,
 * 			FunctionName:           pulumi.String("examplefunctionname"),
 * 			ApiKey:                 pulumi.String("exampleapikey"),
 * 		})
 * 		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.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.appservice.Plan;
 * import com.pulumi.azure.appservice.PlanArgs;
 * import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
 * import com.pulumi.azure.appservice.FunctionApp;
 * import com.pulumi.azure.appservice.FunctionAppArgs;
 * import com.pulumi.azure.streamanalytics.Job;
 * import com.pulumi.azure.streamanalytics.JobArgs;
 * import com.pulumi.azure.streamanalytics.OutputFunction;
 * import com.pulumi.azure.streamanalytics.OutputFunctionArgs;
 * 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 exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplestorageaccount")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("LRS")
 *             .build());
 *         var examplePlan = new Plan("examplePlan", PlanArgs.builder()
 *             .name("exampleappserviceplan")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .kind("FunctionApp")
 *             .reserved(true)
 *             .sku(PlanSkuArgs.builder()
 *                 .tier("Dynamic")
 *                 .size("Y1")
 *                 .build())
 *             .build());
 *         var exampleFunctionApp = new FunctionApp("exampleFunctionApp", FunctionAppArgs.builder()
 *             .name("examplefunctionapp")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .appServicePlanId(examplePlan.id())
 *             .storageAccountName(exampleAccount.name())
 *             .storageAccountAccessKey(exampleAccount.primaryAccessKey())
 *             .osType("linux")
 *             .version("~3")
 *             .build());
 *         var exampleJob = new Job("exampleJob", JobArgs.builder()
 *             .name("examplestreamanalyticsjob")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .streamingUnits(3)
 *             .transformationQuery("""
 *     SELECT *
 *     INTO [YourOutputAlias]
 *     FROM [YourInputAlias]
 *             """)
 *             .build());
 *         var exampleOutputFunction = new OutputFunction("exampleOutputFunction", OutputFunctionArgs.builder()
 *             .name("exampleoutput")
 *             .resourceGroupName(exampleJob.resourceGroupName())
 *             .streamAnalyticsJobName(exampleJob.name())
 *             .functionApp(exampleFunctionApp.name())
 *             .functionName("examplefunctionname")
 *             .apiKey("exampleapikey")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplestorageaccount
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: LRS
 *   examplePlan:
 *     type: azure:appservice:Plan
 *     name: example
 *     properties:
 *       name: exampleappserviceplan
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       kind: FunctionApp
 *       reserved: true
 *       sku:
 *         tier: Dynamic
 *         size: Y1
 *   exampleFunctionApp:
 *     type: azure:appservice:FunctionApp
 *     name: example
 *     properties:
 *       name: examplefunctionapp
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       appServicePlanId: ${examplePlan.id}
 *       storageAccountName: ${exampleAccount.name}
 *       storageAccountAccessKey: ${exampleAccount.primaryAccessKey}
 *       osType: linux
 *       version: ~3
 *   exampleJob:
 *     type: azure:streamanalytics:Job
 *     name: example
 *     properties:
 *       name: examplestreamanalyticsjob
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       streamingUnits: 3
 *       transformationQuery: |2
 *             SELECT *
 *             INTO [YourOutputAlias]
 *             FROM [YourInputAlias]
 *   exampleOutputFunction:
 *     type: azure:streamanalytics:OutputFunction
 *     name: example
 *     properties:
 *       name: exampleoutput
 *       resourceGroupName: ${exampleJob.resourceGroupName}
 *       streamAnalyticsJobName: ${exampleJob.name}
 *       functionApp: ${exampleFunctionApp.name}
 *       functionName: examplefunctionname
 *       apiKey: exampleapikey
 * ```
 * 
 * ## Import
 * Stream Analytics Output Functions can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:streamanalytics/outputFunction:OutputFunction example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
 * ```
 * @property apiKey The API key for the Function.
 * @property batchMaxCount The maximum number of events in each batch that's sent to the function. Defaults to `100`.
 * @property batchMaxInBytes The maximum batch size in bytes that's sent to the function. Defaults to `262144` (256 kB).
 * @property functionApp The name of the Function App.
 * @property functionName The name of the function in the Function App.
 * @property name The name which should be used for this Stream Analytics Output. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the Resource Group where the Stream Analytics Output should exist. Changing this forces a new resource to be created.
 * @property streamAnalyticsJobName The name of the Stream Analytics Job. Changing this forces a new resource to be created.
 */
public data class OutputFunctionArgs(
    public val apiKey: Output? = null,
    public val batchMaxCount: Output? = null,
    public val batchMaxInBytes: Output? = null,
    public val functionApp: Output? = null,
    public val functionName: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val streamAnalyticsJobName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.streamanalytics.OutputFunctionArgs =
        com.pulumi.azure.streamanalytics.OutputFunctionArgs.builder()
            .apiKey(apiKey?.applyValue({ args0 -> args0 }))
            .batchMaxCount(batchMaxCount?.applyValue({ args0 -> args0 }))
            .batchMaxInBytes(batchMaxInBytes?.applyValue({ args0 -> args0 }))
            .functionApp(functionApp?.applyValue({ args0 -> args0 }))
            .functionName(functionName?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .streamAnalyticsJobName(streamAnalyticsJobName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [OutputFunctionArgs].
 */
@PulumiTagMarker
public class OutputFunctionArgsBuilder internal constructor() {
    private var apiKey: Output? = null

    private var batchMaxCount: Output? = null

    private var batchMaxInBytes: Output? = null

    private var functionApp: Output? = null

    private var functionName: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var streamAnalyticsJobName: Output? = null

    /**
     * @param value The API key for the Function.
     */
    @JvmName("ytcxqqhhleixajpd")
    public suspend fun apiKey(`value`: Output) {
        this.apiKey = value
    }

    /**
     * @param value The maximum number of events in each batch that's sent to the function. Defaults to `100`.
     */
    @JvmName("xkfigefxfhereewh")
    public suspend fun batchMaxCount(`value`: Output) {
        this.batchMaxCount = value
    }

    /**
     * @param value The maximum batch size in bytes that's sent to the function. Defaults to `262144` (256 kB).
     */
    @JvmName("kvshdgitcvkucyfb")
    public suspend fun batchMaxInBytes(`value`: Output) {
        this.batchMaxInBytes = value
    }

    /**
     * @param value The name of the Function App.
     */
    @JvmName("nadopfprmjvcjorj")
    public suspend fun functionApp(`value`: Output) {
        this.functionApp = value
    }

    /**
     * @param value The name of the function in the Function App.
     */
    @JvmName("csyajfkrxedgmywm")
    public suspend fun functionName(`value`: Output) {
        this.functionName = value
    }

    /**
     * @param value The name which should be used for this Stream Analytics Output. Changing this forces a new resource to be created.
     */
    @JvmName("wokoutqsmufwyqop")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the Resource Group where the Stream Analytics Output should exist. Changing this forces a new resource to be created.
     */
    @JvmName("afpghysbeggaeqhb")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the Stream Analytics Job. Changing this forces a new resource to be created.
     */
    @JvmName("uiovismkgkuqvyqp")
    public suspend fun streamAnalyticsJobName(`value`: Output) {
        this.streamAnalyticsJobName = value
    }

    /**
     * @param value The API key for the Function.
     */
    @JvmName("tmablsyjfdkypymn")
    public suspend fun apiKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiKey = mapped
    }

    /**
     * @param value The maximum number of events in each batch that's sent to the function. Defaults to `100`.
     */
    @JvmName("wuctdeunmsddjsqk")
    public suspend fun batchMaxCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.batchMaxCount = mapped
    }

    /**
     * @param value The maximum batch size in bytes that's sent to the function. Defaults to `262144` (256 kB).
     */
    @JvmName("tixwthxkxcvijtfd")
    public suspend fun batchMaxInBytes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.batchMaxInBytes = mapped
    }

    /**
     * @param value The name of the Function App.
     */
    @JvmName("mmxhjkfibhguvffi")
    public suspend fun functionApp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.functionApp = mapped
    }

    /**
     * @param value The name of the function in the Function App.
     */
    @JvmName("oegivxujthemfjtj")
    public suspend fun functionName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.functionName = mapped
    }

    /**
     * @param value The name which should be used for this Stream Analytics Output. Changing this forces a new resource to be created.
     */
    @JvmName("bmelbcpdrgwarbyf")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the Resource Group where the Stream Analytics Output should exist. Changing this forces a new resource to be created.
     */
    @JvmName("ppdyqlngekrgeome")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the Stream Analytics Job. Changing this forces a new resource to be created.
     */
    @JvmName("nemfdixfccdqebxq")
    public suspend fun streamAnalyticsJobName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.streamAnalyticsJobName = mapped
    }

    internal fun build(): OutputFunctionArgs = OutputFunctionArgs(
        apiKey = apiKey,
        batchMaxCount = batchMaxCount,
        batchMaxInBytes = batchMaxInBytes,
        functionApp = functionApp,
        functionName = functionName,
        name = name,
        resourceGroupName = resourceGroupName,
        streamAnalyticsJobName = streamAnalyticsJobName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy