com.pulumi.azure.iot.Enrichment 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.iot;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.iot.EnrichmentArgs;
import com.pulumi.azure.iot.inputs.EnrichmentState;
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 an IotHub Enrichment
*
* > **NOTE:** Enrichment can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.Enrichment` resources - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur.
*
* ## 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.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.storage.Container;
* import com.pulumi.azure.storage.ContainerArgs;
* import com.pulumi.azure.iot.IoTHub;
* import com.pulumi.azure.iot.IoTHubArgs;
* import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
* import com.pulumi.azure.iot.EndpointStorageContainer;
* import com.pulumi.azure.iot.EndpointStorageContainerArgs;
* import com.pulumi.azure.iot.Route;
* import com.pulumi.azure.iot.RouteArgs;
* import com.pulumi.azure.iot.Enrichment;
* import com.pulumi.azure.iot.EnrichmentArgs;
* 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 exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
* .name("example")
* .storageAccountName(exampleAccount.name())
* .containerAccessType("private")
* .build());
*
* var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
* .name("exampleIothub")
* .resourceGroupName(example.name())
* .location(example.location())
* .sku(IoTHubSkuArgs.builder()
* .name("S1")
* .capacity("1")
* .build())
* .tags(Map.of("purpose", "testing"))
* .build());
*
* var exampleEndpointStorageContainer = new EndpointStorageContainer("exampleEndpointStorageContainer", EndpointStorageContainerArgs.builder()
* .resourceGroupName(example.name())
* .iothubId(exampleIoTHub.id())
* .name("example")
* .connectionString(exampleAccount.primaryBlobConnectionString())
* .batchFrequencyInSeconds(60)
* .maxChunkSizeInBytes(10485760)
* .containerName(exampleContainer.name())
* .encoding("Avro")
* .fileNameFormat("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}")
* .build());
*
* var exampleRoute = new Route("exampleRoute", RouteArgs.builder()
* .resourceGroupName(example.name())
* .iothubName(exampleIoTHub.name())
* .name("example")
* .source("DeviceMessages")
* .condition("true")
* .endpointNames(exampleEndpointStorageContainer.name())
* .enabled(true)
* .build());
*
* var exampleEnrichment = new Enrichment("exampleEnrichment", EnrichmentArgs.builder()
* .resourceGroupName(example.name())
* .iothubName(exampleIoTHub.name())
* .key("example")
* .value("my value")
* .endpointNames(exampleEndpointStorageContainer.name())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* IoTHub Enrichment can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:iot/enrichment:Enrichment enrichment1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/enrichments/enrichment1
* ```
*
*/
@ResourceType(type="azure:iot/enrichment:Enrichment")
public class Enrichment extends com.pulumi.resources.CustomResource {
/**
* The list of endpoints which will be enriched.
*
*/
@Export(name="endpointNames", refs={List.class,String.class}, tree="[0,1]")
private Output> endpointNames;
/**
* @return The list of endpoints which will be enriched.
*
*/
public Output> endpointNames() {
return this.endpointNames;
}
/**
* The IoTHub name of the enrichment. Changing this forces a new resource to be created.
*
*/
@Export(name="iothubName", refs={String.class}, tree="[0]")
private Output iothubName;
/**
* @return The IoTHub name of the enrichment. Changing this forces a new resource to be created.
*
*/
public Output iothubName() {
return this.iothubName;
}
/**
* The key of the enrichment. Changing this forces a new resource to be created.
*
*/
@Export(name="key", refs={String.class}, tree="[0]")
private Output key;
/**
* @return The key of the enrichment. Changing this forces a new resource to be created.
*
*/
public Output key() {
return this.key;
}
/**
* The name of the resource group under which the IoTHub resource is created. 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 under which the IoTHub resource is created. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* The value of the enrichment. Value can be any static string, the name of the IoT hub sending the message (use `$iothubname`) or information from the device twin (ex: `$twin.tags.latitude`)
*
*/
@Export(name="value", refs={String.class}, tree="[0]")
private Output value;
/**
* @return The value of the enrichment. Value can be any static string, the name of the IoT hub sending the message (use `$iothubname`) or information from the device twin (ex: `$twin.tags.latitude`)
*
*/
public Output value() {
return this.value;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Enrichment(java.lang.String name) {
this(name, EnrichmentArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Enrichment(java.lang.String name, EnrichmentArgs 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 Enrichment(java.lang.String name, EnrichmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:iot/enrichment:Enrichment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Enrichment(java.lang.String name, Output id, @Nullable EnrichmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:iot/enrichment:Enrichment", name, state, makeResourceOptions(options, id), false);
}
private static EnrichmentArgs makeArgs(EnrichmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? EnrichmentArgs.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())
.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 Enrichment get(java.lang.String name, Output id, @Nullable EnrichmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Enrichment(name, id, state, options);
}
}