All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.eventhub.kotlin.DisasterRecoveryConfig.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.eventhub.kotlin

import com.pulumi.azurenative.eventhub.kotlin.outputs.SystemDataResponse
import com.pulumi.azurenative.eventhub.kotlin.outputs.SystemDataResponse.Companion.toKotlin
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.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [DisasterRecoveryConfig].
 */
@PulumiTagMarker
public class DisasterRecoveryConfigResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: DisasterRecoveryConfigArgs = DisasterRecoveryConfigArgs()

    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 DisasterRecoveryConfigArgsBuilder.() -> Unit) {
        val builder = DisasterRecoveryConfigArgsBuilder()
        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(): DisasterRecoveryConfig {
        val builtJavaResource =
            com.pulumi.azurenative.eventhub.DisasterRecoveryConfig(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return DisasterRecoveryConfig(builtJavaResource)
    }
}

/**
 * Single item in List or Get Alias(Disaster Recovery configuration) operation
 * Azure REST API version: 2022-10-01-preview. Prior API version in Azure Native 1.x: 2017-04-01.
 * Other available API versions: 2023-01-01-preview, 2024-01-01, 2024-05-01-preview.
 * ## Example Usage
 * ### EHAliasCreate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var disasterRecoveryConfig = new AzureNative.EventHub.DisasterRecoveryConfig("disasterRecoveryConfig", new()
 *     {
 *         Alias = "sdk-DisasterRecovery-3814",
 *         NamespaceName = "sdk-Namespace-8859",
 *         PartnerNamespace = "sdk-Namespace-37",
 *         ResourceGroupName = "exampleResourceGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	eventhub "github.com/pulumi/pulumi-azure-native-sdk/eventhub/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := eventhub.NewDisasterRecoveryConfig(ctx, "disasterRecoveryConfig", &eventhub.DisasterRecoveryConfigArgs{
 * 			Alias:             pulumi.String("sdk-DisasterRecovery-3814"),
 * 			NamespaceName:     pulumi.String("sdk-Namespace-8859"),
 * 			PartnerNamespace:  pulumi.String("sdk-Namespace-37"),
 * 			ResourceGroupName: pulumi.String("exampleResourceGroup"),
 * 		})
 * 		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.azurenative.eventhub.DisasterRecoveryConfig;
 * import com.pulumi.azurenative.eventhub.DisasterRecoveryConfigArgs;
 * 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 disasterRecoveryConfig = new DisasterRecoveryConfig("disasterRecoveryConfig", DisasterRecoveryConfigArgs.builder()
 *             .alias("sdk-DisasterRecovery-3814")
 *             .namespaceName("sdk-Namespace-8859")
 *             .partnerNamespace("sdk-Namespace-37")
 *             .resourceGroupName("exampleResourceGroup")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:eventhub:DisasterRecoveryConfig sdk-DisasterRecovery-3814 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}
 * ```
 */
public class DisasterRecoveryConfig internal constructor(
    override val javaResource: com.pulumi.azurenative.eventhub.DisasterRecoveryConfig,
) : KotlinCustomResource(javaResource, DisasterRecoveryConfigMapper) {
    /**
     * Alternate name specified when alias and namespace names are same.
     */
    public val alternateName: Output?
        get() = javaResource.alternateName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The geo-location where the resource lives
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name of the resource
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing
     */
    public val partnerNamespace: Output?
        get() = javaResource.partnerNamespace().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Number of entities pending to be replicated.
     */
    public val pendingReplicationOperationsCount: Output
        get() = javaResource.pendingReplicationOperationsCount().applyValue({ args0 -> args0 })

    /**
     * Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'
     */
    public val provisioningState: Output
        get() = javaResource.provisioningState().applyValue({ args0 -> args0 })

    /**
     * role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'
     */
    public val role: Output
        get() = javaResource.role().applyValue({ args0 -> args0 })

    /**
     * The system meta data relating to this resource.
     */
    public val systemData: Output
        get() = javaResource.systemData().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs"
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object DisasterRecoveryConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.eventhub.DisasterRecoveryConfig::class == javaResource::class

    override fun map(javaResource: Resource): DisasterRecoveryConfig =
        DisasterRecoveryConfig(javaResource as com.pulumi.azurenative.eventhub.DisasterRecoveryConfig)
}

/**
 * @see [DisasterRecoveryConfig].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [DisasterRecoveryConfig].
 */
public suspend fun disasterRecoveryConfig(
    name: String,
    block: suspend DisasterRecoveryConfigResourceBuilder.() -> Unit,
): DisasterRecoveryConfig {
    val builder = DisasterRecoveryConfigResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [DisasterRecoveryConfig].
 * @param name The _unique_ name of the resulting resource.
 */
public fun disasterRecoveryConfig(name: String): DisasterRecoveryConfig {
    val builder = DisasterRecoveryConfigResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy