Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.streamanalytics.kotlin.OutputEventHub.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.streamanalytics.kotlin
import com.pulumi.azure.streamanalytics.kotlin.outputs.OutputEventHubSerialization
import com.pulumi.azure.streamanalytics.kotlin.outputs.OutputEventHubSerialization.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.List
/**
* Builder for [OutputEventHub].
*/
@PulumiTagMarker
public class OutputEventHubResourceBuilder internal constructor() {
public var name: String? = null
public var args: OutputEventHubArgs = OutputEventHubArgs()
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 OutputEventHubArgsBuilder.() -> Unit) {
val builder = OutputEventHubArgsBuilder()
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(): OutputEventHub {
val builtJavaResource = com.pulumi.azure.streamanalytics.OutputEventHub(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return OutputEventHub(builtJavaResource)
}
}
/**
* Manages a Stream Analytics Output to an EventHub.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "rg-example",
* location: "West Europe",
* });
* const example = azure.streamanalytics.getJobOutput({
* name: "example-job",
* resourceGroupName: exampleResourceGroup.name,
* });
* const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("example", {
* name: "example-ehnamespace",
* location: exampleResourceGroup.location,
* resourceGroupName: exampleResourceGroup.name,
* sku: "Standard",
* capacity: 1,
* });
* const exampleEventHub = new azure.eventhub.EventHub("example", {
* name: "example-eventhub",
* namespaceName: exampleEventHubNamespace.name,
* resourceGroupName: exampleResourceGroup.name,
* partitionCount: 2,
* messageRetention: 1,
* });
* const exampleOutputEventHub = new azure.streamanalytics.OutputEventHub("example", {
* name: "output-to-eventhub",
* streamAnalyticsJobName: example.apply(example => example.name),
* resourceGroupName: example.apply(example => example.resourceGroupName),
* eventhubName: exampleEventHub.name,
* servicebusNamespace: exampleEventHubNamespace.name,
* sharedAccessPolicyKey: exampleEventHubNamespace.defaultPrimaryKey,
* sharedAccessPolicyName: "RootManageSharedAccessKey",
* serialization: {
* type: "Avro",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example_resource_group = azure.core.ResourceGroup("example",
* name="rg-example",
* location="West Europe")
* example = azure.streamanalytics.get_job_output(name="example-job",
* resource_group_name=example_resource_group.name)
* example_event_hub_namespace = azure.eventhub.EventHubNamespace("example",
* name="example-ehnamespace",
* location=example_resource_group.location,
* resource_group_name=example_resource_group.name,
* sku="Standard",
* capacity=1)
* example_event_hub = azure.eventhub.EventHub("example",
* name="example-eventhub",
* namespace_name=example_event_hub_namespace.name,
* resource_group_name=example_resource_group.name,
* partition_count=2,
* message_retention=1)
* example_output_event_hub = azure.streamanalytics.OutputEventHub("example",
* name="output-to-eventhub",
* stream_analytics_job_name=example.name,
* resource_group_name=example.resource_group_name,
* eventhub_name=example_event_hub.name,
* servicebus_namespace=example_event_hub_namespace.name,
* shared_access_policy_key=example_event_hub_namespace.default_primary_key,
* shared_access_policy_name="RootManageSharedAccessKey",
* serialization={
* "type": "Avro",
* })
* ```
* ```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 = "rg-example",
* Location = "West Europe",
* });
* var example = Azure.StreamAnalytics.GetJob.Invoke(new()
* {
* Name = "example-job",
* ResourceGroupName = exampleResourceGroup.Name,
* });
* var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("example", new()
* {
* Name = "example-ehnamespace",
* Location = exampleResourceGroup.Location,
* ResourceGroupName = exampleResourceGroup.Name,
* Sku = "Standard",
* Capacity = 1,
* });
* var exampleEventHub = new Azure.EventHub.EventHub("example", new()
* {
* Name = "example-eventhub",
* NamespaceName = exampleEventHubNamespace.Name,
* ResourceGroupName = exampleResourceGroup.Name,
* PartitionCount = 2,
* MessageRetention = 1,
* });
* var exampleOutputEventHub = new Azure.StreamAnalytics.OutputEventHub("example", new()
* {
* Name = "output-to-eventhub",
* StreamAnalyticsJobName = example.Apply(getJobResult => getJobResult.Name),
* ResourceGroupName = example.Apply(getJobResult => getJobResult.ResourceGroupName),
* EventhubName = exampleEventHub.Name,
* ServicebusNamespace = exampleEventHubNamespace.Name,
* SharedAccessPolicyKey = exampleEventHubNamespace.DefaultPrimaryKey,
* SharedAccessPolicyName = "RootManageSharedAccessKey",
* Serialization = new Azure.StreamAnalytics.Inputs.OutputEventHubSerializationArgs
* {
* Type = "Avro",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub"
* "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("rg-example"),
* 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)
* exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "example", &eventhub.EventHubNamespaceArgs{
* Name: pulumi.String("example-ehnamespace"),
* Location: exampleResourceGroup.Location,
* ResourceGroupName: exampleResourceGroup.Name,
* Sku: pulumi.String("Standard"),
* Capacity: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* exampleEventHub, err := eventhub.NewEventHub(ctx, "example", &eventhub.EventHubArgs{
* Name: pulumi.String("example-eventhub"),
* NamespaceName: exampleEventHubNamespace.Name,
* ResourceGroupName: exampleResourceGroup.Name,
* PartitionCount: pulumi.Int(2),
* MessageRetention: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* _, err = streamanalytics.NewOutputEventHub(ctx, "example", &streamanalytics.OutputEventHubArgs{
* Name: pulumi.String("output-to-eventhub"),
* StreamAnalyticsJobName: pulumi.String(example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.Name, nil
* }).(pulumi.StringPtrOutput)),
* ResourceGroupName: pulumi.String(example.ApplyT(func(example streamanalytics.GetJobResult) (*string, error) {
* return &example.ResourceGroupName, nil
* }).(pulumi.StringPtrOutput)),
* EventhubName: exampleEventHub.Name,
* ServicebusNamespace: exampleEventHubNamespace.Name,
* SharedAccessPolicyKey: exampleEventHubNamespace.DefaultPrimaryKey,
* SharedAccessPolicyName: pulumi.String("RootManageSharedAccessKey"),
* Serialization: &streamanalytics.OutputEventHubSerializationArgs{
* Type: pulumi.String("Avro"),
* },
* })
* 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.eventhub.EventHubNamespace;
* import com.pulumi.azure.eventhub.EventHubNamespaceArgs;
* import com.pulumi.azure.eventhub.EventHub;
* import com.pulumi.azure.eventhub.EventHubArgs;
* import com.pulumi.azure.streamanalytics.OutputEventHub;
* import com.pulumi.azure.streamanalytics.OutputEventHubArgs;
* import com.pulumi.azure.streamanalytics.inputs.OutputEventHubSerializationArgs;
* 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("rg-example")
* .location("West Europe")
* .build());
* final var example = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
* .name("example-job")
* .resourceGroupName(exampleResourceGroup.name())
* .build());
* var exampleEventHubNamespace = new EventHubNamespace("exampleEventHubNamespace", EventHubNamespaceArgs.builder()
* .name("example-ehnamespace")
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .sku("Standard")
* .capacity(1)
* .build());
* var exampleEventHub = new EventHub("exampleEventHub", EventHubArgs.builder()
* .name("example-eventhub")
* .namespaceName(exampleEventHubNamespace.name())
* .resourceGroupName(exampleResourceGroup.name())
* .partitionCount(2)
* .messageRetention(1)
* .build());
* var exampleOutputEventHub = new OutputEventHub("exampleOutputEventHub", OutputEventHubArgs.builder()
* .name("output-to-eventhub")
* .streamAnalyticsJobName(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.name())))
* .resourceGroupName(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.resourceGroupName())))
* .eventhubName(exampleEventHub.name())
* .servicebusNamespace(exampleEventHubNamespace.name())
* .sharedAccessPolicyKey(exampleEventHubNamespace.defaultPrimaryKey())
* .sharedAccessPolicyName("RootManageSharedAccessKey")
* .serialization(OutputEventHubSerializationArgs.builder()
* .type("Avro")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: rg-example
* location: West Europe
* exampleEventHubNamespace:
* type: azure:eventhub:EventHubNamespace
* name: example
* properties:
* name: example-ehnamespace
* location: ${exampleResourceGroup.location}
* resourceGroupName: ${exampleResourceGroup.name}
* sku: Standard
* capacity: 1
* exampleEventHub:
* type: azure:eventhub:EventHub
* name: example
* properties:
* name: example-eventhub
* namespaceName: ${exampleEventHubNamespace.name}
* resourceGroupName: ${exampleResourceGroup.name}
* partitionCount: 2
* messageRetention: 1
* exampleOutputEventHub:
* type: azure:streamanalytics:OutputEventHub
* name: example
* properties:
* name: output-to-eventhub
* streamAnalyticsJobName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* eventhubName: ${exampleEventHub.name}
* servicebusNamespace: ${exampleEventHubNamespace.name}
* sharedAccessPolicyKey: ${exampleEventHubNamespace.defaultPrimaryKey}
* sharedAccessPolicyName: RootManageSharedAccessKey
* serialization:
* type: Avro
* variables:
* example:
* fn::invoke:
* Function: azure:streamanalytics:getJob
* Arguments:
* name: example-job
* resourceGroupName: ${exampleResourceGroup.name}
* ```
*
* ## Import
* Stream Analytics Outputs to an EventHub can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:streamanalytics/outputEventHub:OutputEventHub example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
* ```
*/
public class OutputEventHub internal constructor(
override val javaResource: com.pulumi.azure.streamanalytics.OutputEventHub,
) : KotlinCustomResource(javaResource, OutputEventHubMapper) {
/**
* The authentication mode for the Stream Output. Possible values are `Msi` and `ConnectionString`. Defaults to `ConnectionString`.
*/
public val authenticationMode: Output?
get() = javaResource.authenticationMode().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the Event Hub.
*/
public val eventhubName: Output
get() = javaResource.eventhubName().applyValue({ args0 -> args0 })
/**
* The name of the Stream Output. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The column that is used for the Event Hub partition key.
*/
public val partitionKey: Output?
get() = javaResource.partitionKey().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A list of property columns to add to the Event Hub output.
*/
public val propertyColumns: Output>?
get() = javaResource.propertyColumns().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* A `serialization` block as defined below.
*/
public val serialization: Output
get() = javaResource.serialization().applyValue({ args0 ->
args0.let({ args0 ->
toKotlin(args0)
})
})
/**
* The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc.
*/
public val servicebusNamespace: Output
get() = javaResource.servicebusNamespace().applyValue({ args0 -> args0 })
/**
* The shared access policy key for the specified shared access policy. Required when `authentication_mode` is set to `ConnectionString`.
*/
public val sharedAccessPolicyKey: Output?
get() = javaResource.sharedAccessPolicyKey().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required when `authentication_mode` is set to `ConnectionString`.
*/
public val sharedAccessPolicyName: Output?
get() = javaResource.sharedAccessPolicyName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*/
public val streamAnalyticsJobName: Output
get() = javaResource.streamAnalyticsJobName().applyValue({ args0 -> args0 })
}
public object OutputEventHubMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.streamanalytics.OutputEventHub::class == javaResource::class
override fun map(javaResource: Resource): OutputEventHub = OutputEventHub(
javaResource as
com.pulumi.azure.streamanalytics.OutputEventHub,
)
}
/**
* @see [OutputEventHub].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [OutputEventHub].
*/
public suspend fun outputEventHub(
name: String,
block: suspend OutputEventHubResourceBuilder.() -> Unit,
): OutputEventHub {
val builder = OutputEventHubResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [OutputEventHub].
* @param name The _unique_ name of the resulting resource.
*/
public fun outputEventHub(name: String): OutputEventHub {
val builder = OutputEventHubResourceBuilder()
builder.name(name)
return builder.build()
}