com.pulumi.azure.streamanalytics.kotlin.StreamInputIotHubArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.streamanalytics.kotlin
import com.pulumi.azure.streamanalytics.StreamInputIotHubArgs.builder
import com.pulumi.azure.streamanalytics.kotlin.inputs.StreamInputIotHubSerializationArgs
import com.pulumi.azure.streamanalytics.kotlin.inputs.StreamInputIotHubSerializationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Manages a Stream Analytics Stream Input IoTHub.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const example = azure.streamanalytics.getJobOutput({
* name: "example-job",
* resourceGroupName: exampleResourceGroup.name,
* });
* const exampleIoTHub = new azure.iot.IoTHub("example", {
* name: "example-iothub",
* resourceGroupName: exampleResourceGroup.name,
* location: exampleResourceGroup.location,
* sku: {
* name: "S1",
* capacity: 1,
* },
* });
* const exampleStreamInputIotHub = new azure.streamanalytics.StreamInputIotHub("example", {
* name: "example-iothub-input",
* streamAnalyticsJobName: example.apply(example => example.name),
* resourceGroupName: example.apply(example => example.resourceGroupName),
* endpoint: "messages/events",
* eventhubConsumerGroupName: "$Default",
* iothubNamespace: exampleIoTHub.name,
* sharedAccessPolicyKey: exampleIoTHub.sharedAccessPolicies.apply(sharedAccessPolicies => sharedAccessPolicies[0].primaryKey),
* sharedAccessPolicyName: "iothubowner",
* serialization: {
* type: "Json",
* encoding: "UTF8",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example_resource_group = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example = azure.streamanalytics.get_job_output(name="example-job",
* resource_group_name=example_resource_group.name)
* example_io_t_hub = azure.iot.IoTHub("example",
* name="example-iothub",
* resource_group_name=example_resource_group.name,
* location=example_resource_group.location,
* sku=azure.iot.IoTHubSkuArgs(
* name="S1",
* capacity=1,
* ))
* example_stream_input_iot_hub = azure.streamanalytics.StreamInputIotHub("example",
* name="example-iothub-input",
* stream_analytics_job_name=example.name,
* resource_group_name=example.resource_group_name,
* endpoint="messages/events",
* eventhub_consumer_group_name="$Default",
* iothub_namespace=example_io_t_hub.name,
* shared_access_policy_key=example_io_t_hub.shared_access_policies[0].primary_key,
* shared_access_policy_name="iothubowner",
* serialization=azure.streamanalytics.StreamInputIotHubSerializationArgs(
* type="Json",
* encoding="UTF8",
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var example = Azure.StreamAnalytics.GetJob.Invoke(new()
* {
* Name = "example-job",
* ResourceGroupName = exampleResourceGroup.Name,
* });
* var exampleIoTHub = new Azure.Iot.IoTHub("example", new()
* {
* Name = "example-iothub",
* ResourceGroupName = exampleResourceGroup.Name,
* Location = exampleResourceGroup.Location,
* Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
* {
* Name = "S1",
* Capacity = 1,
* },
* });
* var exampleStreamInputIotHub = new Azure.StreamAnalytics.StreamInputIotHub("example", new()
* {
* Name = "example-iothub-input",
* StreamAnalyticsJobName = example.Apply(getJobResult => getJobResult.Name),
* ResourceGroupName = example.Apply(getJobResult => getJobResult.ResourceGroupName),
* Endpoint = "messages/events",
* EventhubConsumerGroupName = "$Default",
* IothubNamespace = exampleIoTHub.Name,
* SharedAccessPolicyKey = exampleIoTHub.SharedAccessPolicies.Apply(sharedAccessPolicies => sharedAccessPolicies[0].PrimaryKey),
* SharedAccessPolicyName = "iothubowner",
* Serialization = new Azure.StreamAnalytics.Inputs.StreamInputIotHubSerializationArgs
* {
* Type = "Json",
* Encoding = "UTF8",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot"
* "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 {
* exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* example := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{
* Name: pulumi.String("example-job"),
* ResourceGroupName: exampleResourceGroup.Name,
* }, nil)
* exampleIoTHub, err := iot.NewIoTHub(ctx, "example", &iot.IoTHubArgs{
* Name: pulumi.String("example-iothub"),
* ResourceGroupName: exampleResourceGroup.Name,
* Location: exampleResourceGroup.Location,
* Sku: &iot.IoTHubSkuArgs{
* Name: pulumi.String("S1"),
* Capacity: pulumi.Int(1),
* },
* })
* if err != nil {
* return err
* }
* _, err = streamanalytics.NewStreamInputIotHub(ctx, "example", &streamanalytics.StreamInputIotHubArgs{
* Name: pulumi.String("example-iothub-input"),
* StreamAnalyticsJobName: example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.Name, nil
* }).(pulumi.StringPtrOutput),
* ResourceGroupName: example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.ResourceGroupName, nil
* }).(pulumi.StringPtrOutput),
* Endpoint: pulumi.String("messages/events"),
* EventhubConsumerGroupName: pulumi.String("$Default"),
* IothubNamespace: exampleIoTHub.Name,
* SharedAccessPolicyKey: exampleIoTHub.SharedAccessPolicies.ApplyT(func(sharedAccessPolicies []iot.IoTHubSharedAccessPolicy) (*string, error) {
* return &sharedAccessPolicies[0].PrimaryKey, nil
* }).(pulumi.StringPtrOutput),
* SharedAccessPolicyName: pulumi.String("iothubowner"),
* Serialization: &streamanalytics.StreamInputIotHubSerializationArgs{
* Type: pulumi.String("Json"),
* Encoding: pulumi.String("UTF8"),
* },
* })
* 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.streamanalytics.StreamanalyticsFunctions;
* import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
* import com.pulumi.azure.iot.IoTHub;
* import com.pulumi.azure.iot.IoTHubArgs;
* import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
* import com.pulumi.azure.streamanalytics.StreamInputIotHub;
* import com.pulumi.azure.streamanalytics.StreamInputIotHubArgs;
* import com.pulumi.azure.streamanalytics.inputs.StreamInputIotHubSerializationArgs;
* 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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* final var example = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
* .name("example-job")
* .resourceGroupName(exampleResourceGroup.name())
* .build());
* var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
* .name("example-iothub")
* .resourceGroupName(exampleResourceGroup.name())
* .location(exampleResourceGroup.location())
* .sku(IoTHubSkuArgs.builder()
* .name("S1")
* .capacity("1")
* .build())
* .build());
* var exampleStreamInputIotHub = new StreamInputIotHub("exampleStreamInputIotHub", StreamInputIotHubArgs.builder()
* .name("example-iothub-input")
* .streamAnalyticsJobName(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.name())))
* .resourceGroupName(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.resourceGroupName())))
* .endpoint("messages/events")
* .eventhubConsumerGroupName("$Default")
* .iothubNamespace(exampleIoTHub.name())
* .sharedAccessPolicyKey(exampleIoTHub.sharedAccessPolicies().applyValue(sharedAccessPolicies -> sharedAccessPolicies[0].primaryKey()))
* .sharedAccessPolicyName("iothubowner")
* .serialization(StreamInputIotHubSerializationArgs.builder()
* .type("Json")
* .encoding("UTF8")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: example-resources
* location: West Europe
* exampleIoTHub:
* type: azure:iot:IoTHub
* name: example
* properties:
* name: example-iothub
* resourceGroupName: ${exampleResourceGroup.name}
* location: ${exampleResourceGroup.location}
* sku:
* name: S1
* capacity: '1'
* exampleStreamInputIotHub:
* type: azure:streamanalytics:StreamInputIotHub
* name: example
* properties:
* name: example-iothub-input
* streamAnalyticsJobName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* endpoint: messages/events
* eventhubConsumerGroupName: $Default
* iothubNamespace: ${exampleIoTHub.name}
* sharedAccessPolicyKey: ${exampleIoTHub.sharedAccessPolicies[0].primaryKey}
* sharedAccessPolicyName: iothubowner
* serialization:
* type: Json
* encoding: UTF8
* variables:
* example:
* fn::invoke:
* Function: azure:streamanalytics:getJob
* Arguments:
* name: example-job
* resourceGroupName: ${exampleResourceGroup.name}
* ```
*
* ## Import
* Stream Analytics Stream Input IoTHub's can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:streamanalytics/streamInputIotHub:StreamInputIotHub example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/inputs/input1
* ```
* @property endpoint The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).
* @property eventhubConsumerGroupName The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.
* @property iothubNamespace The name or the URI of the IoT Hub.
* @property name The name of the Stream Input IoTHub. Changing this forces a new resource to be created.
* @property resourceGroupName The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
* @property serialization A `serialization` block as defined below.
* @property sharedAccessPolicyKey The shared access policy key for the specified shared access policy. Changing this forces a new resource to be created.
* @property sharedAccessPolicyName The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
* @property streamAnalyticsJobName The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
public data class StreamInputIotHubArgs(
public val endpoint: Output? = null,
public val eventhubConsumerGroupName: Output? = null,
public val iothubNamespace: Output? = null,
public val name: Output? = null,
public val resourceGroupName: Output? = null,
public val serialization: Output? = null,
public val sharedAccessPolicyKey: Output? = null,
public val sharedAccessPolicyName: Output? = null,
public val streamAnalyticsJobName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.streamanalytics.StreamInputIotHubArgs =
com.pulumi.azure.streamanalytics.StreamInputIotHubArgs.builder()
.endpoint(endpoint?.applyValue({ args0 -> args0 }))
.eventhubConsumerGroupName(eventhubConsumerGroupName?.applyValue({ args0 -> args0 }))
.iothubNamespace(iothubNamespace?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.serialization(serialization?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.sharedAccessPolicyKey(sharedAccessPolicyKey?.applyValue({ args0 -> args0 }))
.sharedAccessPolicyName(sharedAccessPolicyName?.applyValue({ args0 -> args0 }))
.streamAnalyticsJobName(streamAnalyticsJobName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [StreamInputIotHubArgs].
*/
@PulumiTagMarker
public class StreamInputIotHubArgsBuilder internal constructor() {
private var endpoint: Output? = null
private var eventhubConsumerGroupName: Output? = null
private var iothubNamespace: Output? = null
private var name: Output? = null
private var resourceGroupName: Output? = null
private var serialization: Output? = null
private var sharedAccessPolicyKey: Output? = null
private var sharedAccessPolicyName: Output? = null
private var streamAnalyticsJobName: Output? = null
/**
* @param value The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).
*/
@JvmName("pejlixmuiplrpfmj")
public suspend fun endpoint(`value`: Output) {
this.endpoint = value
}
/**
* @param value The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.
*/
@JvmName("cweknaqnusxfxqkb")
public suspend fun eventhubConsumerGroupName(`value`: Output) {
this.eventhubConsumerGroupName = value
}
/**
* @param value The name or the URI of the IoT Hub.
*/
@JvmName("oxututtnaepmbgag")
public suspend fun iothubNamespace(`value`: Output) {
this.iothubNamespace = value
}
/**
* @param value The name of the Stream Input IoTHub. Changing this forces a new resource to be created.
*/
@JvmName("pigkgouyevduysgq")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
*/
@JvmName("rinjxainteyinhly")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value A `serialization` block as defined below.
*/
@JvmName("nasfcbrmwjopicfw")
public suspend fun serialization(`value`: Output) {
this.serialization = value
}
/**
* @param value The shared access policy key for the specified shared access policy. Changing this forces a new resource to be created.
*/
@JvmName("mdqjhuxybhqkwxxj")
public suspend fun sharedAccessPolicyKey(`value`: Output) {
this.sharedAccessPolicyKey = value
}
/**
* @param value The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
*/
@JvmName("skasvskuvqlsjuor")
public suspend fun sharedAccessPolicyName(`value`: Output) {
this.sharedAccessPolicyName = value
}
/**
* @param value The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
@JvmName("buksqyjepuddtexn")
public suspend fun streamAnalyticsJobName(`value`: Output) {
this.streamAnalyticsJobName = value
}
/**
* @param value The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).
*/
@JvmName("lnutyocrcssoichn")
public suspend fun endpoint(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.endpoint = mapped
}
/**
* @param value The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub.
*/
@JvmName("cgeekhimivdfsdat")
public suspend fun eventhubConsumerGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.eventhubConsumerGroupName = mapped
}
/**
* @param value The name or the URI of the IoT Hub.
*/
@JvmName("aogjargpjadtlwmo")
public suspend fun iothubNamespace(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.iothubNamespace = mapped
}
/**
* @param value The name of the Stream Input IoTHub. Changing this forces a new resource to be created.
*/
@JvmName("uurvlgxxdkhbvqqv")
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 Job exists. Changing this forces a new resource to be created.
*/
@JvmName("limejurbnbtmtqiv")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value A `serialization` block as defined below.
*/
@JvmName("awkfurchvrphvhnt")
public suspend fun serialization(`value`: StreamInputIotHubSerializationArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.serialization = mapped
}
/**
* @param argument A `serialization` block as defined below.
*/
@JvmName("rcprwbnltennkjvq")
public suspend
fun serialization(argument: suspend StreamInputIotHubSerializationArgsBuilder.() -> Unit) {
val toBeMapped = StreamInputIotHubSerializationArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.serialization = mapped
}
/**
* @param value The shared access policy key for the specified shared access policy. Changing this forces a new resource to be created.
*/
@JvmName("rvmgnhlpfkmxtpsy")
public suspend fun sharedAccessPolicyKey(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sharedAccessPolicyKey = mapped
}
/**
* @param value The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
*/
@JvmName("gcjcfbydwlyrlmri")
public suspend fun sharedAccessPolicyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sharedAccessPolicyName = mapped
}
/**
* @param value The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
@JvmName("ghrwgmwmrcwukvjv")
public suspend fun streamAnalyticsJobName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.streamAnalyticsJobName = mapped
}
internal fun build(): StreamInputIotHubArgs = StreamInputIotHubArgs(
endpoint = endpoint,
eventhubConsumerGroupName = eventhubConsumerGroupName,
iothubNamespace = iothubNamespace,
name = name,
resourceGroupName = resourceGroupName,
serialization = serialization,
sharedAccessPolicyKey = sharedAccessPolicyKey,
sharedAccessPolicyName = sharedAccessPolicyName,
streamAnalyticsJobName = streamAnalyticsJobName,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy