
com.pulumi.azure.relay.kotlin.HybridConnection.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.relay.kotlin
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
/**
* Builder for [HybridConnection].
*/
@PulumiTagMarker
public class HybridConnectionResourceBuilder internal constructor() {
public var name: String? = null
public var args: HybridConnectionArgs = HybridConnectionArgs()
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 HybridConnectionArgsBuilder.() -> Unit) {
val builder = HybridConnectionArgsBuilder()
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(): HybridConnection {
val builtJavaResource = com.pulumi.azure.relay.HybridConnection(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return HybridConnection(builtJavaResource)
}
}
/**
* Manages an Azure Relay Hybrid Connection.
* ## 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.relay.Namespace("example", {
* name: "example-relay",
* location: example.location,
* resourceGroupName: example.name,
* skuName: "Standard",
* tags: {
* source: "managed",
* },
* });
* const exampleHybridConnection = new azure.relay.HybridConnection("example", {
* name: "acctestrnhc-%d",
* resourceGroupName: example.name,
* relayNamespaceName: exampleNamespace.name,
* requiresClientAuthorization: false,
* userMetadata: "testmetadata",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_namespace = azure.relay.Namespace("example",
* name="example-relay",
* location=example.location,
* resource_group_name=example.name,
* sku_name="Standard",
* tags={
* "source": "managed",
* })
* example_hybrid_connection = azure.relay.HybridConnection("example",
* name="acctestrnhc-%d",
* resource_group_name=example.name,
* relay_namespace_name=example_namespace.name,
* requires_client_authorization=False,
* user_metadata="testmetadata")
* ```
* ```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.Relay.Namespace("example", new()
* {
* Name = "example-relay",
* Location = example.Location,
* ResourceGroupName = example.Name,
* SkuName = "Standard",
* Tags =
* {
* { "source", "managed" },
* },
* });
* var exampleHybridConnection = new Azure.Relay.HybridConnection("example", new()
* {
* Name = "acctestrnhc-%d",
* ResourceGroupName = example.Name,
* RelayNamespaceName = exampleNamespace.Name,
* RequiresClientAuthorization = false,
* UserMetadata = "testmetadata",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay"
* "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 := relay.NewNamespace(ctx, "example", &relay.NamespaceArgs{
* Name: pulumi.String("example-relay"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* SkuName: pulumi.String("Standard"),
* Tags: pulumi.StringMap{
* "source": pulumi.String("managed"),
* },
* })
* if err != nil {
* return err
* }
* _, err = relay.NewHybridConnection(ctx, "example", &relay.HybridConnectionArgs{
* Name: pulumi.String("acctestrnhc-%d"),
* ResourceGroupName: example.Name,
* RelayNamespaceName: exampleNamespace.Name,
* RequiresClientAuthorization: pulumi.Bool(false),
* UserMetadata: pulumi.String("testmetadata"),
* })
* 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.relay.Namespace;
* import com.pulumi.azure.relay.NamespaceArgs;
* import com.pulumi.azure.relay.HybridConnection;
* import com.pulumi.azure.relay.HybridConnectionArgs;
* 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("example-relay")
* .location(example.location())
* .resourceGroupName(example.name())
* .skuName("Standard")
* .tags(Map.of("source", "managed"))
* .build());
* var exampleHybridConnection = new HybridConnection("exampleHybridConnection", HybridConnectionArgs.builder()
* .name("acctestrnhc-%d")
* .resourceGroupName(example.name())
* .relayNamespaceName(exampleNamespace.name())
* .requiresClientAuthorization(false)
* .userMetadata("testmetadata")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleNamespace:
* type: azure:relay:Namespace
* name: example
* properties:
* name: example-relay
* location: ${example.location}
* resourceGroupName: ${example.name}
* skuName: Standard
* tags:
* source: managed
* exampleHybridConnection:
* type: azure:relay:HybridConnection
* name: example
* properties:
* name: acctestrnhc-%d
* resourceGroupName: ${example.name}
* relayNamespaceName: ${exampleNamespace.name}
* requiresClientAuthorization: false
* userMetadata: testmetadata
* ```
*
* ## Import
* Relay Hybrid Connection's can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:relay/hybridConnection:HybridConnection relay1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Relay/namespaces/relay1/hybridConnections/hconn1
* ```
*/
public class HybridConnection internal constructor(
override val javaResource: com.pulumi.azure.relay.HybridConnection,
) : KotlinCustomResource(javaResource, HybridConnectionMapper) {
/**
* Specifies the name of the Azure Relay Hybrid Connection. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The name of the Azure Relay in which to create the Azure Relay Hybrid Connection. Changing this forces a new resource to be created.
*/
public val relayNamespaceName: Output
get() = javaResource.relayNamespaceName().applyValue({ args0 -> args0 })
/**
* Specify if client authorization is needed for this hybrid connection. Changing this forces a new resource to be created. Defaults to `true`.
*/
public val requiresClientAuthorization: Output?
get() = javaResource.requiresClientAuthorization().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the resource group in which to create the Azure Relay Hybrid Connection. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* The usermetadata is a placeholder to store user-defined string data for the hybrid connection endpoint. For example, it can be used to store descriptive data, such as a list of teams and their contact information. Also, user-defined configuration settings can be stored.
*/
public val userMetadata: Output?
get() = javaResource.userMetadata().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object HybridConnectionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.relay.HybridConnection::class == javaResource::class
override fun map(javaResource: Resource): HybridConnection = HybridConnection(
javaResource as
com.pulumi.azure.relay.HybridConnection,
)
}
/**
* @see [HybridConnection].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [HybridConnection].
*/
public suspend fun hybridConnection(
name: String,
block: suspend HybridConnectionResourceBuilder.() -> Unit,
): HybridConnection {
val builder = HybridConnectionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [HybridConnection].
* @param name The _unique_ name of the resulting resource.
*/
public fun hybridConnection(name: String): HybridConnection {
val builder = HybridConnectionResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy