com.pulumi.azure.streamanalytics.StreamInputIotHub 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.StreamInputIotHubArgs;
import com.pulumi.azure.streamanalytics.inputs.StreamInputIotHubState;
import com.pulumi.azure.streamanalytics.outputs.StreamInputIotHubSerialization;
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 javax.annotation.Nullable;
/**
* Manages a Stream Analytics Stream Input IoTHub.
*
* ## 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.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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## 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
* ```
*
*/
@ResourceType(type="azure:streamanalytics/streamInputIotHub:StreamInputIotHub")
public class StreamInputIotHub extends com.pulumi.resources.CustomResource {
/**
* The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).
*
*/
@Export(name="endpoint", refs={String.class}, tree="[0]")
private Output endpoint;
/**
* @return The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).
*
*/
public Output endpoint() {
return this.endpoint;
}
/**
* 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.
*
*/
@Export(name="eventhubConsumerGroupName", refs={String.class}, tree="[0]")
private Output 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.
*
*/
public Output eventhubConsumerGroupName() {
return this.eventhubConsumerGroupName;
}
/**
* The name or the URI of the IoT Hub.
*
*/
@Export(name="iothubNamespace", refs={String.class}, tree="[0]")
private Output iothubNamespace;
/**
* @return The name or the URI of the IoT Hub.
*
*/
public Output iothubNamespace() {
return this.iothubNamespace;
}
/**
* The name of the Stream Input IoTHub. 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 IoTHub. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the Resource Group where the Stream Analytics Job exists. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* A `serialization` block as defined below.
*
*/
@Export(name="serialization", refs={StreamInputIotHubSerialization.class}, tree="[0]")
private Output serialization;
/**
* @return A `serialization` block as defined below.
*
*/
public Output serialization() {
return this.serialization;
}
/**
* The shared access policy key for the specified shared access policy. Changing this forces a new resource to be created.
*
*/
@Export(name="sharedAccessPolicyKey", refs={String.class}, tree="[0]")
private Output sharedAccessPolicyKey;
/**
* @return The shared access policy key for the specified shared access policy. Changing this forces a new resource to be created.
*
*/
public Output sharedAccessPolicyKey() {
return 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 sharedAccessPolicyName;
/**
* @return The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc.
*
*/
public Output sharedAccessPolicyName() {
return this.sharedAccessPolicyName;
}
/**
* The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*
*/
@Export(name="streamAnalyticsJobName", refs={String.class}, tree="[0]")
private Output streamAnalyticsJobName;
/**
* @return The name of the Stream Analytics Job. Changing this forces a new resource to be created.
*
*/
public Output streamAnalyticsJobName() {
return this.streamAnalyticsJobName;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public StreamInputIotHub(java.lang.String name) {
this(name, StreamInputIotHubArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public StreamInputIotHub(java.lang.String name, StreamInputIotHubArgs 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 StreamInputIotHub(java.lang.String name, StreamInputIotHubArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:streamanalytics/streamInputIotHub:StreamInputIotHub", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private StreamInputIotHub(java.lang.String name, Output id, @Nullable StreamInputIotHubState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:streamanalytics/streamInputIotHub:StreamInputIotHub", name, state, makeResourceOptions(options, id), false);
}
private static StreamInputIotHubArgs makeArgs(StreamInputIotHubArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? StreamInputIotHubArgs.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 StreamInputIotHub get(java.lang.String name, Output id, @Nullable StreamInputIotHubState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new StreamInputIotHub(name, id, state, options);
}
}