com.pulumi.azure.streamanalytics.StreamInputEventHubV2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.streamanalytics;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.streamanalytics.StreamInputEventHubV2Args;
import com.pulumi.azure.streamanalytics.inputs.StreamInputEventHubV2State;
import com.pulumi.azure.streamanalytics.outputs.StreamInputEventHubV2Serialization;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* > **Note:** This resource creates a Stream Input of type `Microsoft.EventHub/EventHub`, to create a Stream Input of type `Microsoft.ServiceBus/EventHub` please use the resource azurerm_stream_analytics_stream_input_eventhub.
*
* Manages a Stream Analytics Stream Input EventHub V2.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.eventhub.ConsumerGroup;
* import com.pulumi.azure.eventhub.ConsumerGroupArgs;
* import com.pulumi.azure.streamanalytics.StreamInputEventHubV2;
* import com.pulumi.azure.streamanalytics.StreamInputEventHubV2Args;
* import com.pulumi.azure.streamanalytics.inputs.StreamInputEventHubV2SerializationArgs;
* 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 exampleEventHubNamespace = new EventHubNamespace("exampleEventHubNamespace", EventHubNamespaceArgs.builder()
* .name("example-namespace")
* .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 exampleConsumerGroup = new ConsumerGroup("exampleConsumerGroup", ConsumerGroupArgs.builder()
* .name("example-consumergroup")
* .namespaceName(exampleEventHubNamespace.name())
* .eventhubName(exampleEventHub.name())
* .resourceGroupName(exampleResourceGroup.name())
* .build());
*
* var exampleStreamInputEventHubV2 = new StreamInputEventHubV2("exampleStreamInputEventHubV2", StreamInputEventHubV2Args.builder()
* .name("eventhub-stream-input")
* .streamAnalyticsJobId(example.applyValue(getJobResult -> getJobResult).applyValue(example -> example.applyValue(getJobResult -> getJobResult.id())))
* .eventhubConsumerGroupName(exampleConsumerGroup.name())
* .eventhubName(exampleEventHub.name())
* .servicebusNamespace(exampleEventHubNamespace.name())
* .sharedAccessPolicyKey(exampleEventHubNamespace.defaultPrimaryKey())
* .sharedAccessPolicyName("RootManageSharedAccessKey")
* .serialization(StreamInputEventHubV2SerializationArgs.builder()
* .type("Json")
* .encoding("UTF8")
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:streamanalytics/streamInputEventHubV2:StreamInputEventHubV2 example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/inputs/input1
* ```
*
*/
@ResourceType(type="azure:streamanalytics/streamInputEventHubV2:StreamInputEventHubV2")
public class StreamInputEventHubV2 extends com.pulumi.resources.CustomResource {
/**
* The authentication mode for the Stream Output. Possible values are `Msi` and `ConnectionString`. Defaults to `ConnectionString`.
*
*/
@Export(name="authenticationMode", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> authenticationMode;
/**
* @return The authentication mode for the Stream Output. Possible values are `Msi` and `ConnectionString`. Defaults to `ConnectionString`.
*
*/
public Output> authenticationMode() {
return Codegen.optional(this.authenticationMode);
}
/**
* 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. If not set the input will use the Event Hub's default consumer group.
*
*/
@Export(name="eventhubConsumerGroupName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> eventhubConsumerGroupName;
/**
* @return 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. If not set the input will use the Event Hub's default consumer group.
*
*/
public Output> eventhubConsumerGroupName() {
return Codegen.optional(this.eventhubConsumerGroupName);
}
/**
* The name of the Event Hub.
*
*/
@Export(name="eventhubName", refs={String.class}, tree="[0]")
private Output eventhubName;
/**
* @return The name of the Event Hub.
*
*/
public Output eventhubName() {
return this.eventhubName;
}
/**
* The name of the Stream Input EventHub V2. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the Stream Input EventHub V2. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The property the input Event Hub has been partitioned by.
*
*/
@Export(name="partitionKey", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> partitionKey;
/**
* @return The property the input Event Hub has been partitioned by.
*
*/
public Output> partitionKey() {
return Codegen.optional(this.partitionKey);
}
/**
* A `serialization` block as defined below.
*
*/
@Export(name="serialization", refs={StreamInputEventHubV2Serialization.class}, tree="[0]")
private Output serialization;
/**
* @return A `serialization` block as defined below.
*
*/
public Output serialization() {
return this.serialization;
}
/**
* The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc.
*
*/
@Export(name="servicebusNamespace", refs={String.class}, tree="[0]")
private Output servicebusNamespace;
/**
* @return The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc.
*
*/
public Output servicebusNamespace() {
return this.servicebusNamespace;
}
/**
* The shared access policy key for the specified shared access policy.
*
*/
@Export(name="sharedAccessPolicyKey", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sharedAccessPolicyKey;
/**
* @return The shared access policy key for the specified shared access policy.
*
*/
public Output> sharedAccessPolicyKey() {
return Codegen.optional(this.sharedAccessPolicyKey);
}
/**
* The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
*
*/
@Export(name="sharedAccessPolicyName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sharedAccessPolicyName;
/**
* @return The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
*
*/
public Output> sharedAccessPolicyName() {
return Codegen.optional(this.sharedAccessPolicyName);
}
/**
* The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*
*/
@Export(name="streamAnalyticsJobId", refs={String.class}, tree="[0]")
private Output streamAnalyticsJobId;
/**
* @return The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*
*/
public Output streamAnalyticsJobId() {
return this.streamAnalyticsJobId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public StreamInputEventHubV2(java.lang.String name) {
this(name, StreamInputEventHubV2Args.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public StreamInputEventHubV2(java.lang.String name, StreamInputEventHubV2Args args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public StreamInputEventHubV2(java.lang.String name, StreamInputEventHubV2Args args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:streamanalytics/streamInputEventHubV2:StreamInputEventHubV2", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private StreamInputEventHubV2(java.lang.String name, Output id, @Nullable StreamInputEventHubV2State state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:streamanalytics/streamInputEventHubV2:StreamInputEventHubV2", name, state, makeResourceOptions(options, id), false);
}
private static StreamInputEventHubV2Args makeArgs(StreamInputEventHubV2Args args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? StreamInputEventHubV2Args.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.additionalSecretOutputs(List.of(
"sharedAccessPolicyKey"
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static StreamInputEventHubV2 get(java.lang.String name, Output id, @Nullable StreamInputEventHubV2State state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new StreamInputEventHubV2(name, id, state, options);
}
}