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

com.pulumi.awsnative.backup.kotlin.BackupPlan.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.backup.kotlin

import com.pulumi.awsnative.backup.kotlin.outputs.BackupPlanResourceType
import com.pulumi.awsnative.backup.kotlin.outputs.BackupPlanResourceType.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: BackupPlanArgs = BackupPlanArgs()

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

/**
 * Resource Type definition for AWS::Backup::BackupPlan
 */
public class BackupPlan internal constructor(
    override val javaResource: com.pulumi.awsnative.backup.BackupPlan,
) : KotlinCustomResource(javaResource, BackupPlanMapper) {
    /**
     * Uniquely identifies the backup plan to be associated with the selection of resources.
     */
    public val backupPlan: Output
        get() = javaResource.backupPlan().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * An Amazon Resource Name (ARN) that uniquely identifies a backup plan; for example, `arn:aws:backup:us-east-1:123456789012:plan:8F81F553-3A74-4A3F-B93D-B3360DC80C50` .
     */
    public val backupPlanArn: Output
        get() = javaResource.backupPlanArn().applyValue({ args0 -> args0 })

    /**
     * Uniquely identifies a backup plan.
     */
    public val backupPlanId: Output
        get() = javaResource.backupPlanId().applyValue({ args0 -> args0 })

    /**
     * The tags to assign to the backup plan.
     */
    public val backupPlanTags: Output>?
        get() = javaResource.backupPlanTags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.key.to(args0.value) }).toMap()
            }).orElse(null)
        })

    /**
     * Unique, randomly generated, Unicode, UTF-8 encoded strings that are at most 1,024 bytes long. Version Ids cannot be edited.
     */
    public val versionId: Output
        get() = javaResource.versionId().applyValue({ args0 -> args0 })
}

public object BackupPlanMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.backup.BackupPlan::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy