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

com.pulumi.awsnative.msk.kotlin.Replicator.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.msk.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.msk.kotlin.outputs.ReplicatorKafkaCluster
import com.pulumi.awsnative.msk.kotlin.outputs.ReplicatorReplicationInfo
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
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.msk.kotlin.outputs.ReplicatorKafkaCluster.Companion.toKotlin as replicatorKafkaClusterToKotlin
import com.pulumi.awsnative.msk.kotlin.outputs.ReplicatorReplicationInfo.Companion.toKotlin as replicatorReplicationInfoToKotlin

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

    public var args: ReplicatorArgs = ReplicatorArgs()

    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 ReplicatorArgsBuilder.() -> Unit) {
        val builder = ReplicatorArgsBuilder()
        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(): Replicator {
        val builtJavaResource = com.pulumi.awsnative.msk.Replicator(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Replicator(builtJavaResource)
    }
}

/**
 * Resource Type definition for AWS::MSK::Replicator
 */
public class Replicator internal constructor(
    override val javaResource: com.pulumi.awsnative.msk.Replicator,
) : KotlinCustomResource(javaResource, ReplicatorMapper) {
    /**
     * The current version of the MSK replicator.
     */
    public val currentVersion: Output?
        get() = javaResource.currentVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A summary description of the replicator.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies a list of Kafka clusters which are targets of the replicator.
     */
    public val kafkaClusters: Output>
        get() = javaResource.kafkaClusters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> replicatorKafkaClusterToKotlin(args0) })
            })
        })

    /**
     * A list of replication configurations, where each configuration targets a given source cluster to target cluster replication flow.
     */
    public val replicationInfoList: Output>
        get() = javaResource.replicationInfoList().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> replicatorReplicationInfoToKotlin(args0) })
            })
        })

    /**
     * Amazon Resource Name for the created replicator.
     */
    public val replicatorArn: Output
        get() = javaResource.replicatorArn().applyValue({ args0 -> args0 })

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

    /**
     * The Amazon Resource Name (ARN) of the IAM role used by the replicator to access external resources.
     */
    public val serviceExecutionRoleArn: Output
        get() = javaResource.serviceExecutionRoleArn().applyValue({ args0 -> args0 })

    /**
     * A collection of tags associated with a resource
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object ReplicatorMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.msk.Replicator::class == javaResource::class

    override fun map(javaResource: Resource): Replicator = Replicator(
        javaResource as
            com.pulumi.awsnative.msk.Replicator,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy