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

com.pulumi.awsnative.backup.kotlin.Framework.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: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.backup.kotlin

import com.pulumi.awsnative.backup.kotlin.outputs.FrameworkControl
import com.pulumi.awsnative.kotlin.outputs.Tag
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.backup.kotlin.outputs.FrameworkControl.Companion.toKotlin as frameworkControlToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: FrameworkArgs = FrameworkArgs()

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

/**
 * Contains detailed information about a framework. Frameworks contain controls, which evaluate and report on your backup events and resources. Frameworks generate daily compliance results.
 */
public class Framework internal constructor(
    override val javaResource: com.pulumi.awsnative.backup.Framework,
) : KotlinCustomResource(javaResource, FrameworkMapper) {
    /**
     * The date and time that a framework is created, in ISO 8601 representation. The value of CreationTime is accurate to milliseconds. For example, 2020-07-10T15:00:00.000-08:00 represents the 10th of July 2020 at 3:00 PM 8 hours behind UTC.
     */
    public val creationTime: Output
        get() = javaResource.creationTime().applyValue({ args0 -> args0 })

    /**
     * The deployment status of a framework. The statuses are: `CREATE_IN_PROGRESS | UPDATE_IN_PROGRESS | DELETE_IN_PROGRESS | COMPLETED | FAILED`
     */
    public val deploymentStatus: Output
        get() = javaResource.deploymentStatus().applyValue({ args0 -> args0 })

    /**
     * An Amazon Resource Name (ARN) that uniquely identifies Framework as a resource
     */
    public val frameworkArn: Output
        get() = javaResource.frameworkArn().applyValue({ args0 -> args0 })

    /**
     * Contains detailed information about all of the controls of a framework. Each framework must contain at least one control.
     */
    public val frameworkControls: Output>
        get() = javaResource.frameworkControls().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> frameworkControlToKotlin(args0) })
            })
        })

    /**
     * An optional description of the framework with a maximum 1,024 characters.
     */
    public val frameworkDescription: Output?
        get() = javaResource.frameworkDescription().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The unique name of a framework. This name is between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).
     */
    public val frameworkName: Output?
        get() = javaResource.frameworkName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A framework consists of one or more controls. Each control governs a resource, such as backup plans, backup selections, backup vaults, or recovery points. You can also turn AWS Config recording on or off for each resource. The statuses are:
     * `ACTIVE` when recording is turned on for all resources governed by the framework.
     * `PARTIALLY_ACTIVE` when recording is turned off for at least one resource governed by the framework.
     * `INACTIVE` when recording is turned off for all resources governed by the framework.
     * `UNAVAILABLE` when AWS Backup is unable to validate recording status at this time.
     */
    public val frameworkStatus: Output
        get() = javaResource.frameworkStatus().applyValue({ args0 -> args0 })

    /**
     * Metadata that you can assign to help organize the frameworks that you create. Each tag is a key-value pair.
     */
    public val frameworkTags: Output>?
        get() = javaResource.frameworkTags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.let({ args0 -> tagToKotlin(args0) }) })
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy