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

com.pulumi.awsnative.elasticache.kotlin.ServerlessCache.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.elasticache.kotlin

import com.pulumi.awsnative.elasticache.kotlin.outputs.ServerlessCacheCacheUsageLimits
import com.pulumi.awsnative.elasticache.kotlin.outputs.ServerlessCacheEndpoint
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.elasticache.kotlin.outputs.ServerlessCacheCacheUsageLimits.Companion.toKotlin as serverlessCacheCacheUsageLimitsToKotlin
import com.pulumi.awsnative.elasticache.kotlin.outputs.ServerlessCacheEndpoint.Companion.toKotlin as serverlessCacheEndpointToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: ServerlessCacheArgs = ServerlessCacheArgs()

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

/**
 * The AWS::ElastiCache::ServerlessCache resource creates an Amazon ElastiCache Serverless Cache.
 */
public class ServerlessCache internal constructor(
    override val javaResource: com.pulumi.awsnative.elasticache.ServerlessCache,
) : KotlinCustomResource(javaResource, ServerlessCacheMapper) {
    /**
     * The ARN of the Serverless Cache.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The cache usage limit for the serverless cache.
     */
    public val cacheUsageLimits: Output?
        get() = javaResource.cacheUsageLimits().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> serverlessCacheCacheUsageLimitsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The creation time of the Serverless Cache.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * The daily time range (in UTC) during which the service takes automatic snapshot of the Serverless Cache.
     */
    public val dailySnapshotTime: Output?
        get() = javaResource.dailySnapshotTime().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * Represents the information required for client programs to connect to a cache node. This value is read-only.
     */
    public val endpoint: Output?
        get() = javaResource.endpoint().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    serverlessCacheEndpointToKotlin(args0)
                })
            }).orElse(null)
        })

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

    /**
     * The final snapshot name which is taken before Serverless Cache is deleted.
     */
    public val finalSnapshotName: Output?
        get() = javaResource.finalSnapshotName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The full engine version of the Serverless Cache.
     */
    public val fullEngineVersion: Output
        get() = javaResource.fullEngineVersion().applyValue({ args0 -> args0 })

    /**
     * The ID of the KMS key used to encrypt the cluster.
     */
    public val kmsKeyId: Output?
        get() = javaResource.kmsKeyId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The major engine version of the Serverless Cache.
     */
    public val majorEngineVersion: Output?
        get() = javaResource.majorEngineVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Represents the information required for client programs to connect to a cache node. This value is read-only.
     */
    public val readerEndpoint: Output?
        get() = javaResource.readerEndpoint().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> serverlessCacheEndpointToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * One or more Amazon VPC security groups associated with this Serverless Cache.
     */
    public val securityGroupIds: Output>?
        get() = javaResource.securityGroupIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The name of the Serverless Cache. This value must be unique.
     */
    public val serverlessCacheName: Output
        get() = javaResource.serverlessCacheName().applyValue({ args0 -> args0 })

    /**
     * The ARN's of snapshot to restore Serverless Cache.
     */
    public val snapshotArnsToRestore: Output>?
        get() = javaResource.snapshotArnsToRestore().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The snapshot retention limit of the Serverless Cache.
     */
    public val snapshotRetentionLimit: Output?
        get() = javaResource.snapshotRetentionLimit().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The status of the Serverless Cache.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * The subnet id's of the Serverless Cache.
     */
    public val subnetIds: Output>?
        get() = javaResource.subnetIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * An array of key-value pairs to apply to this Serverless Cache.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The ID of the user group.
     */
    public val userGroupId: Output?
        get() = javaResource.userGroupId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object ServerlessCacheMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.elasticache.ServerlessCache::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy