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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.iot.kotlin
import com.pulumi.azure.iot.EndpointServicebusTopicArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages an IotHub ServiceBus Topic Endpoint
* > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleNamespace = new azure.servicebus.Namespace("example", {
* name: "exampleNamespace",
* location: example.location,
* resourceGroupName: example.name,
* sku: "Standard",
* });
* const exampleTopic = new azure.servicebus.Topic("example", {
* name: "exampleTopic",
* namespaceId: exampleNamespace.id,
* });
* const exampleTopicAuthorizationRule = new azure.servicebus.TopicAuthorizationRule("example", {
* name: "exampleRule",
* topicId: exampleTopic.id,
* listen: false,
* send: true,
* manage: false,
* });
* const exampleIoTHub = new azure.iot.IoTHub("example", {
* name: "exampleIothub",
* resourceGroupName: example.name,
* location: example.location,
* sku: {
* name: "B1",
* capacity: 1,
* },
* tags: {
* purpose: "example",
* },
* });
* const exampleEndpointServicebusTopic = new azure.iot.EndpointServicebusTopic("example", {
* resourceGroupName: example.name,
* iothubId: exampleIoTHub.id,
* name: "example",
* connectionString: exampleTopicAuthorizationRule.primaryConnectionString,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_namespace = azure.servicebus.Namespace("example",
* name="exampleNamespace",
* location=example.location,
* resource_group_name=example.name,
* sku="Standard")
* example_topic = azure.servicebus.Topic("example",
* name="exampleTopic",
* namespace_id=example_namespace.id)
* example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("example",
* name="exampleRule",
* topic_id=example_topic.id,
* listen=False,
* send=True,
* manage=False)
* example_io_t_hub = azure.iot.IoTHub("example",
* name="exampleIothub",
* resource_group_name=example.name,
* location=example.location,
* sku={
* "name": "B1",
* "capacity": 1,
* },
* tags={
* "purpose": "example",
* })
* example_endpoint_servicebus_topic = azure.iot.EndpointServicebusTopic("example",
* resource_group_name=example.name,
* iothub_id=example_io_t_hub.id,
* name="example",
* connection_string=example_topic_authorization_rule.primary_connection_string)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleNamespace = new Azure.ServiceBus.Namespace("example", new()
* {
* Name = "exampleNamespace",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = "Standard",
* });
* var exampleTopic = new Azure.ServiceBus.Topic("example", new()
* {
* Name = "exampleTopic",
* NamespaceId = exampleNamespace.Id,
* });
* var exampleTopicAuthorizationRule = new Azure.ServiceBus.TopicAuthorizationRule("example", new()
* {
* Name = "exampleRule",
* TopicId = exampleTopic.Id,
* Listen = false,
* Send = true,
* Manage = false,
* });
* var exampleIoTHub = new Azure.Iot.IoTHub("example", new()
* {
* Name = "exampleIothub",
* ResourceGroupName = example.Name,
* Location = example.Location,
* Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
* {
* Name = "B1",
* Capacity = 1,
* },
* Tags =
* {
* { "purpose", "example" },
* },
* });
* var exampleEndpointServicebusTopic = new Azure.Iot.EndpointServicebusTopic("example", new()
* {
* ResourceGroupName = example.Name,
* IothubId = exampleIoTHub.Id,
* Name = "example",
* ConnectionString = exampleTopicAuthorizationRule.PrimaryConnectionString,
* });
* });
* ```
* ```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/servicebus"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleNamespace, err := servicebus.NewNamespace(ctx, "example", &servicebus.NamespaceArgs{
* Name: pulumi.String("exampleNamespace"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: pulumi.String("Standard"),
* })
* if err != nil {
* return err
* }
* exampleTopic, err := servicebus.NewTopic(ctx, "example", &servicebus.TopicArgs{
* Name: pulumi.String("exampleTopic"),
* NamespaceId: exampleNamespace.ID(),
* })
* if err != nil {
* return err
* }
* exampleTopicAuthorizationRule, err := servicebus.NewTopicAuthorizationRule(ctx, "example", &servicebus.TopicAuthorizationRuleArgs{
* Name: pulumi.String("exampleRule"),
* TopicId: exampleTopic.ID(),
* Listen: pulumi.Bool(false),
* Send: pulumi.Bool(true),
* Manage: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* exampleIoTHub, err := iot.NewIoTHub(ctx, "example", &iot.IoTHubArgs{
* Name: pulumi.String("exampleIothub"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* Sku: &iot.IoTHubSkuArgs{
* Name: pulumi.String("B1"),
* Capacity: pulumi.Int(1),
* },
* Tags: pulumi.StringMap{
* "purpose": pulumi.String("example"),
* },
* })
* if err != nil {
* return err
* }
* _, err = iot.NewEndpointServicebusTopic(ctx, "example", &iot.EndpointServicebusTopicArgs{
* ResourceGroupName: example.Name,
* IothubId: exampleIoTHub.ID(),
* Name: pulumi.String("example"),
* ConnectionString: exampleTopicAuthorizationRule.PrimaryConnectionString,
* })
* 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.servicebus.Namespace;
* import com.pulumi.azure.servicebus.NamespaceArgs;
* import com.pulumi.azure.servicebus.Topic;
* import com.pulumi.azure.servicebus.TopicArgs;
* import com.pulumi.azure.servicebus.TopicAuthorizationRule;
* import com.pulumi.azure.servicebus.TopicAuthorizationRuleArgs;
* import com.pulumi.azure.iot.IoTHub;
* import com.pulumi.azure.iot.IoTHubArgs;
* import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
* import com.pulumi.azure.iot.EndpointServicebusTopic;
* import com.pulumi.azure.iot.EndpointServicebusTopicArgs;
* 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 exampleNamespace = new Namespace("exampleNamespace", NamespaceArgs.builder()
* .name("exampleNamespace")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("Standard")
* .build());
* var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
* .name("exampleTopic")
* .namespaceId(exampleNamespace.id())
* .build());
* var exampleTopicAuthorizationRule = new TopicAuthorizationRule("exampleTopicAuthorizationRule", TopicAuthorizationRuleArgs.builder()
* .name("exampleRule")
* .topicId(exampleTopic.id())
* .listen(false)
* .send(true)
* .manage(false)
* .build());
* var exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
* .name("exampleIothub")
* .resourceGroupName(example.name())
* .location(example.location())
* .sku(IoTHubSkuArgs.builder()
* .name("B1")
* .capacity("1")
* .build())
* .tags(Map.of("purpose", "example"))
* .build());
* var exampleEndpointServicebusTopic = new EndpointServicebusTopic("exampleEndpointServicebusTopic", EndpointServicebusTopicArgs.builder()
* .resourceGroupName(example.name())
* .iothubId(exampleIoTHub.id())
* .name("example")
* .connectionString(exampleTopicAuthorizationRule.primaryConnectionString())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleNamespace:
* type: azure:servicebus:Namespace
* name: example
* properties:
* name: exampleNamespace
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku: Standard
* exampleTopic:
* type: azure:servicebus:Topic
* name: example
* properties:
* name: exampleTopic
* namespaceId: ${exampleNamespace.id}
* exampleTopicAuthorizationRule:
* type: azure:servicebus:TopicAuthorizationRule
* name: example
* properties:
* name: exampleRule
* topicId: ${exampleTopic.id}
* listen: false
* send: true
* manage: false
* exampleIoTHub:
* type: azure:iot:IoTHub
* name: example
* properties:
* name: exampleIothub
* resourceGroupName: ${example.name}
* location: ${example.location}
* sku:
* name: B1
* capacity: '1'
* tags:
* purpose: example
* exampleEndpointServicebusTopic:
* type: azure:iot:EndpointServicebusTopic
* name: example
* properties:
* resourceGroupName: ${example.name}
* iothubId: ${exampleIoTHub.id}
* name: example
* connectionString: ${exampleTopicAuthorizationRule.primaryConnectionString}
* ```
*
* ## Import
* IoTHub ServiceBus Topic Endpoint can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:iot/endpointServicebusTopic:EndpointServicebusTopic servicebus_topic1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/hub1/endpoints/servicebustopic_endpoint1
* ```
* @property authenticationType Type used to authenticate against the Service Bus Topic endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`.
* @property connectionString The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`.
* @property endpointUri URI of the Service Bus endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
* @property entityPath Name of the Service Bus Topic. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
* @property identityId ID of the User Managed Identity used to authenticate against the Service Bus Topic endpoint.
* > **NOTE:** `identity_id` can only be specified when `authentication_type` is `identityBased`. It must be one of the `identity_ids` of the Iot Hub. If not specified when `authentication_type` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used.
* @property iothubId The IoTHub ID for the endpoint. Changing this forces a new resource to be created.
* @property name The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`. Changing this forces a new resource to be created.
* @property resourceGroupName The name of the resource group under which the Service Bus Topic has been created. Changing this forces a new resource to be created.
*/
public data class EndpointServicebusTopicArgs(
public val authenticationType: Output? = null,
public val connectionString: Output? = null,
public val endpointUri: Output? = null,
public val entityPath: Output? = null,
public val identityId: Output? = null,
public val iothubId: Output? = null,
public val name: Output? = null,
public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.iot.EndpointServicebusTopicArgs =
com.pulumi.azure.iot.EndpointServicebusTopicArgs.builder()
.authenticationType(authenticationType?.applyValue({ args0 -> args0 }))
.connectionString(connectionString?.applyValue({ args0 -> args0 }))
.endpointUri(endpointUri?.applyValue({ args0 -> args0 }))
.entityPath(entityPath?.applyValue({ args0 -> args0 }))
.identityId(identityId?.applyValue({ args0 -> args0 }))
.iothubId(iothubId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [EndpointServicebusTopicArgs].
*/
@PulumiTagMarker
public class EndpointServicebusTopicArgsBuilder internal constructor() {
private var authenticationType: Output? = null
private var connectionString: Output? = null
private var endpointUri: Output? = null
private var entityPath: Output? = null
private var identityId: Output? = null
private var iothubId: Output? = null
private var name: Output? = null
private var resourceGroupName: Output? = null
/**
* @param value Type used to authenticate against the Service Bus Topic endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`.
*/
@JvmName("ljckinbnhlvpddwa")
public suspend fun authenticationType(`value`: Output) {
this.authenticationType = value
}
/**
* @param value The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`.
*/
@JvmName("sstirvuyumjnrubf")
public suspend fun connectionString(`value`: Output) {
this.connectionString = value
}
/**
* @param value URI of the Service Bus endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
*/
@JvmName("rqlgxsyfwvlmkiit")
public suspend fun endpointUri(`value`: Output) {
this.endpointUri = value
}
/**
* @param value Name of the Service Bus Topic. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
*/
@JvmName("tpmntfsftvyhrfuo")
public suspend fun entityPath(`value`: Output) {
this.entityPath = value
}
/**
* @param value ID of the User Managed Identity used to authenticate against the Service Bus Topic endpoint.
* > **NOTE:** `identity_id` can only be specified when `authentication_type` is `identityBased`. It must be one of the `identity_ids` of the Iot Hub. If not specified when `authentication_type` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used.
*/
@JvmName("ppkyckaqflpwfufj")
public suspend fun identityId(`value`: Output) {
this.identityId = value
}
/**
* @param value The IoTHub ID for the endpoint. Changing this forces a new resource to be created.
*/
@JvmName("lwrfvopxfpkuwttg")
public suspend fun iothubId(`value`: Output) {
this.iothubId = value
}
/**
* @param value The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`. Changing this forces a new resource to be created.
*/
@JvmName("wyulalfhmhdmedwv")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The name of the resource group under which the Service Bus Topic has been created. Changing this forces a new resource to be created.
*/
@JvmName("tildknycghljggnm")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value Type used to authenticate against the Service Bus Topic endpoint. Possible values are `keyBased` and `identityBased`. Defaults to `keyBased`.
*/
@JvmName("mtrxnmjslrafqdqf")
public suspend fun authenticationType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.authenticationType = mapped
}
/**
* @param value The connection string for the endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `keyBased`.
*/
@JvmName("cxlkbvtrfiuuhgod")
public suspend fun connectionString(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.connectionString = mapped
}
/**
* @param value URI of the Service Bus endpoint. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
*/
@JvmName("ahlnnqdyetkygois")
public suspend fun endpointUri(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.endpointUri = mapped
}
/**
* @param value Name of the Service Bus Topic. This attribute can only be specified and is mandatory when `authentication_type` is `identityBased`.
*/
@JvmName("aqwbceqlthadvkxr")
public suspend fun entityPath(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.entityPath = mapped
}
/**
* @param value ID of the User Managed Identity used to authenticate against the Service Bus Topic endpoint.
* > **NOTE:** `identity_id` can only be specified when `authentication_type` is `identityBased`. It must be one of the `identity_ids` of the Iot Hub. If not specified when `authentication_type` is `identityBased`, System Assigned Managed Identity of the Iot Hub will be used.
*/
@JvmName("wmpnejefpvuwtotq")
public suspend fun identityId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.identityId = mapped
}
/**
* @param value The IoTHub ID for the endpoint. Changing this forces a new resource to be created.
*/
@JvmName("twuanjkrmmojlhab")
public suspend fun iothubId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.iothubId = mapped
}
/**
* @param value The name of the endpoint. The name must be unique across endpoint types. The following names are reserved: `events`, `operationsMonitoringEvents`, `fileNotifications` and `$default`. Changing this forces a new resource to be created.
*/
@JvmName("gvykendavwnfucga")
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 under which the Service Bus Topic has been created. Changing this forces a new resource to be created.
*/
@JvmName("barmexfjgynagllo")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
internal fun build(): EndpointServicebusTopicArgs = EndpointServicebusTopicArgs(
authenticationType = authenticationType,
connectionString = connectionString,
endpointUri = endpointUri,
entityPath = entityPath,
identityId = identityId,
iothubId = iothubId,
name = name,
resourceGroupName = resourceGroupName,
)
}