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

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

package com.pulumi.awsnative.events.kotlin

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.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: ArchiveArgs = ArchiveArgs()

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

/**
 * Resource Type definition for AWS::Events::Archive
 */
public class Archive internal constructor(
    override val javaResource: com.pulumi.awsnative.events.Archive,
) : KotlinCustomResource(javaResource, ArchiveMapper) {
    /**
     * The name for the archive to create.
     */
    public val archiveName: Output?
        get() = javaResource.archiveName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ARN of the archive created.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

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

    /**
     * An event pattern to use to filter events sent to the archive.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Events::Archive` for more information about the expected schema for this property.
     */
    public val eventPattern: Output?
        get() = javaResource.eventPattern().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely
     */
    public val retentionDays: Output?
        get() = javaResource.retentionDays().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ARN of the event bus that sends events to the archive.
     */
    public val sourceArn: Output
        get() = javaResource.sourceArn().applyValue({ args0 -> args0 })
}

public object ArchiveMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.events.Archive::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy