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

com.pulumi.awsnative.imagebuilder.kotlin.LifecyclePolicy.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.imagebuilder.kotlin

import com.pulumi.awsnative.imagebuilder.kotlin.enums.LifecyclePolicyResourceType
import com.pulumi.awsnative.imagebuilder.kotlin.enums.LifecyclePolicyStatus
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.LifecyclePolicyPolicyDetail
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.LifecyclePolicyResourceSelection
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 kotlin.collections.Map
import com.pulumi.awsnative.imagebuilder.kotlin.enums.LifecyclePolicyResourceType.Companion.toKotlin as lifecyclePolicyResourceTypeToKotlin
import com.pulumi.awsnative.imagebuilder.kotlin.enums.LifecyclePolicyStatus.Companion.toKotlin as lifecyclePolicyStatusToKotlin
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.LifecyclePolicyPolicyDetail.Companion.toKotlin as lifecyclePolicyPolicyDetailToKotlin
import com.pulumi.awsnative.imagebuilder.kotlin.outputs.LifecyclePolicyResourceSelection.Companion.toKotlin as lifecyclePolicyResourceSelectionToKotlin

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

    public var args: LifecyclePolicyArgs = LifecyclePolicyArgs()

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

/**
 * Resource schema for AWS::ImageBuilder::LifecyclePolicy
 */
public class LifecyclePolicy internal constructor(
    override val javaResource: com.pulumi.awsnative.imagebuilder.LifecyclePolicy,
) : KotlinCustomResource(javaResource, LifecyclePolicyMapper) {
    /**
     * The Amazon Resource Name (ARN) of the lifecycle policy.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

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

    /**
     * The execution role of the lifecycle policy.
     */
    public val executionRole: Output
        get() = javaResource.executionRole().applyValue({ args0 -> args0 })

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

    /**
     * The policy details of the lifecycle policy.
     */
    public val policyDetails: Output>
        get() = javaResource.policyDetails().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> lifecyclePolicyPolicyDetailToKotlin(args0) })
            })
        })

    /**
     * The resource selection of the lifecycle policy.
     */
    public val resourceSelection: Output
        get() = javaResource.resourceSelection().applyValue({ args0 ->
            args0.let({ args0 ->
                lifecyclePolicyResourceSelectionToKotlin(args0)
            })
        })

    /**
     * The resource type of the lifecycle policy.
     */
    public val resourceType: Output
        get() = javaResource.resourceType().applyValue({ args0 ->
            args0.let({ args0 ->
                lifecyclePolicyResourceTypeToKotlin(args0)
            })
        })

    /**
     * The status of the lifecycle policy.
     */
    public val status: Output?
        get() = javaResource.status().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    lifecyclePolicyStatusToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The tags associated with the lifecycle policy.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })
}

public object LifecyclePolicyMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.imagebuilder.LifecyclePolicy::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy