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

com.pulumi.awsnative.lightsail.kotlin.DatabaseArgs.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.lightsail.kotlin

import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.awsnative.lightsail.DatabaseArgs.builder
import com.pulumi.awsnative.lightsail.kotlin.inputs.DatabaseRelationalDatabaseParameterArgs
import com.pulumi.awsnative.lightsail.kotlin.inputs.DatabaseRelationalDatabaseParameterArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::Lightsail::Database
 * @property availabilityZone The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format.
 * @property backupRetention When true, enables automated backup retention for your database. Updates are applied during the next maintenance window because this can result in an outage.
 * @property caCertificateIdentifier Indicates the certificate that needs to be associated with the database.
 * @property masterDatabaseName The name of the database to create when the Lightsail database resource is created. For MySQL, if this parameter isn't specified, no database is created in the database resource. For PostgreSQL, if this parameter isn't specified, a database named postgres is created in the database resource.
 * @property masterUserPassword The password for the master user. The password can include any printable ASCII character except "/", """, or "@". It cannot contain spaces.
 * @property masterUsername The name for the master user.
 * @property preferredBackupWindow The daily time range during which automated backups are created for your new database if automated backups are enabled.
 * @property preferredMaintenanceWindow The weekly time range during which system maintenance can occur on your new database.
 * @property publiclyAccessible Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database.
 * @property relationalDatabaseBlueprintId The blueprint ID for your new database. A blueprint describes the major engine version of a database.
 * @property relationalDatabaseBundleId The bundle ID for your new database. A bundle describes the performance specifications for your database.
 * @property relationalDatabaseName The name to use for your new Lightsail database resource.
 * @property relationalDatabaseParameters Update one or more parameters of the relational database.
 * @property rotateMasterUserPassword When true, the master user password is changed to a new strong password generated by Lightsail. Use the get relational database master user password operation to get the new password.
 * @property tags An array of key-value pairs to apply to this resource.
 */
public data class DatabaseArgs(
    public val availabilityZone: Output? = null,
    public val backupRetention: Output? = null,
    public val caCertificateIdentifier: Output? = null,
    public val masterDatabaseName: Output? = null,
    public val masterUserPassword: Output? = null,
    public val masterUsername: Output? = null,
    public val preferredBackupWindow: Output? = null,
    public val preferredMaintenanceWindow: Output? = null,
    public val publiclyAccessible: Output? = null,
    public val relationalDatabaseBlueprintId: Output? = null,
    public val relationalDatabaseBundleId: Output? = null,
    public val relationalDatabaseName: Output? = null,
    public val relationalDatabaseParameters: Output>? =
        null,
    public val rotateMasterUserPassword: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.lightsail.DatabaseArgs =
        com.pulumi.awsnative.lightsail.DatabaseArgs.builder()
            .availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
            .backupRetention(backupRetention?.applyValue({ args0 -> args0 }))
            .caCertificateIdentifier(caCertificateIdentifier?.applyValue({ args0 -> args0 }))
            .masterDatabaseName(masterDatabaseName?.applyValue({ args0 -> args0 }))
            .masterUserPassword(masterUserPassword?.applyValue({ args0 -> args0 }))
            .masterUsername(masterUsername?.applyValue({ args0 -> args0 }))
            .preferredBackupWindow(preferredBackupWindow?.applyValue({ args0 -> args0 }))
            .preferredMaintenanceWindow(preferredMaintenanceWindow?.applyValue({ args0 -> args0 }))
            .publiclyAccessible(publiclyAccessible?.applyValue({ args0 -> args0 }))
            .relationalDatabaseBlueprintId(relationalDatabaseBlueprintId?.applyValue({ args0 -> args0 }))
            .relationalDatabaseBundleId(relationalDatabaseBundleId?.applyValue({ args0 -> args0 }))
            .relationalDatabaseName(relationalDatabaseName?.applyValue({ args0 -> args0 }))
            .relationalDatabaseParameters(
                relationalDatabaseParameters?.applyValue({ args0 ->
                    args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .rotateMasterUserPassword(rotateMasterUserPassword?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [DatabaseArgs].
 */
@PulumiTagMarker
public class DatabaseArgsBuilder internal constructor() {
    private var availabilityZone: Output? = null

    private var backupRetention: Output? = null

    private var caCertificateIdentifier: Output? = null

    private var masterDatabaseName: Output? = null

    private var masterUserPassword: Output? = null

    private var masterUsername: Output? = null

    private var preferredBackupWindow: Output? = null

    private var preferredMaintenanceWindow: Output? = null

    private var publiclyAccessible: Output? = null

    private var relationalDatabaseBlueprintId: Output? = null

    private var relationalDatabaseBundleId: Output? = null

    private var relationalDatabaseName: Output? = null

    private var relationalDatabaseParameters: Output>? =
        null

    private var rotateMasterUserPassword: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format.
     */
    @JvmName("eatbdpqqlmdcdprr")
    public suspend fun availabilityZone(`value`: Output) {
        this.availabilityZone = value
    }

    /**
     * @param value When true, enables automated backup retention for your database. Updates are applied during the next maintenance window because this can result in an outage.
     */
    @JvmName("canybkxwhyrehqtk")
    public suspend fun backupRetention(`value`: Output) {
        this.backupRetention = value
    }

    /**
     * @param value Indicates the certificate that needs to be associated with the database.
     */
    @JvmName("alxwhcucdjohvpnn")
    public suspend fun caCertificateIdentifier(`value`: Output) {
        this.caCertificateIdentifier = value
    }

    /**
     * @param value The name of the database to create when the Lightsail database resource is created. For MySQL, if this parameter isn't specified, no database is created in the database resource. For PostgreSQL, if this parameter isn't specified, a database named postgres is created in the database resource.
     */
    @JvmName("kghkguuulmkejflo")
    public suspend fun masterDatabaseName(`value`: Output) {
        this.masterDatabaseName = value
    }

    /**
     * @param value The password for the master user. The password can include any printable ASCII character except "/", """, or "@". It cannot contain spaces.
     */
    @JvmName("tnopsflgqmojllui")
    public suspend fun masterUserPassword(`value`: Output) {
        this.masterUserPassword = value
    }

    /**
     * @param value The name for the master user.
     */
    @JvmName("tvwtxobrvdiwirgl")
    public suspend fun masterUsername(`value`: Output) {
        this.masterUsername = value
    }

    /**
     * @param value The daily time range during which automated backups are created for your new database if automated backups are enabled.
     */
    @JvmName("ggimadkigpsesksu")
    public suspend fun preferredBackupWindow(`value`: Output) {
        this.preferredBackupWindow = value
    }

    /**
     * @param value The weekly time range during which system maintenance can occur on your new database.
     */
    @JvmName("utrliddqjjnsvtvi")
    public suspend fun preferredMaintenanceWindow(`value`: Output) {
        this.preferredMaintenanceWindow = value
    }

    /**
     * @param value Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database.
     */
    @JvmName("rlxfamenyoimtksw")
    public suspend fun publiclyAccessible(`value`: Output) {
        this.publiclyAccessible = value
    }

    /**
     * @param value The blueprint ID for your new database. A blueprint describes the major engine version of a database.
     */
    @JvmName("opsmuatcwspiwcth")
    public suspend fun relationalDatabaseBlueprintId(`value`: Output) {
        this.relationalDatabaseBlueprintId = value
    }

    /**
     * @param value The bundle ID for your new database. A bundle describes the performance specifications for your database.
     */
    @JvmName("gdwxdcyqhksrsrtv")
    public suspend fun relationalDatabaseBundleId(`value`: Output) {
        this.relationalDatabaseBundleId = value
    }

    /**
     * @param value The name to use for your new Lightsail database resource.
     */
    @JvmName("qhgrfffnuntgievf")
    public suspend fun relationalDatabaseName(`value`: Output) {
        this.relationalDatabaseName = value
    }

    /**
     * @param value Update one or more parameters of the relational database.
     */
    @JvmName("pgxvrkiemobfgrll")
    public suspend fun relationalDatabaseParameters(`value`: Output>) {
        this.relationalDatabaseParameters = value
    }

    @JvmName("noyonfgofijtpgil")
    public suspend fun relationalDatabaseParameters(vararg values: Output) {
        this.relationalDatabaseParameters = Output.all(values.asList())
    }

    /**
     * @param values Update one or more parameters of the relational database.
     */
    @JvmName("vrxdcehlsqtureww")
    public suspend fun relationalDatabaseParameters(values: List>) {
        this.relationalDatabaseParameters = Output.all(values)
    }

    /**
     * @param value When true, the master user password is changed to a new strong password generated by Lightsail. Use the get relational database master user password operation to get the new password.
     */
    @JvmName("knjblvmtdbujohxl")
    public suspend fun rotateMasterUserPassword(`value`: Output) {
        this.rotateMasterUserPassword = value
    }

    /**
     * @param value An array of key-value pairs to apply to this resource.
     */
    @JvmName("rxeymibwmpywhypg")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    @JvmName("lxvvkgtctcljpsem")
    public suspend fun tags(vararg values: Output) {
        this.tags = Output.all(values.asList())
    }

    /**
     * @param values An array of key-value pairs to apply to this resource.
     */
    @JvmName("dbbdmjdmtrdonxgn")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value The Availability Zone in which to create your new database. Use the us-east-2a case-sensitive format.
     */
    @JvmName("qijpdktidbpnghpw")
    public suspend fun availabilityZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availabilityZone = mapped
    }

    /**
     * @param value When true, enables automated backup retention for your database. Updates are applied during the next maintenance window because this can result in an outage.
     */
    @JvmName("gakertfblcjsmpea")
    public suspend fun backupRetention(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backupRetention = mapped
    }

    /**
     * @param value Indicates the certificate that needs to be associated with the database.
     */
    @JvmName("skdqrilhjyptfucu")
    public suspend fun caCertificateIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.caCertificateIdentifier = mapped
    }

    /**
     * @param value The name of the database to create when the Lightsail database resource is created. For MySQL, if this parameter isn't specified, no database is created in the database resource. For PostgreSQL, if this parameter isn't specified, a database named postgres is created in the database resource.
     */
    @JvmName("cawncidrwsukianv")
    public suspend fun masterDatabaseName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.masterDatabaseName = mapped
    }

    /**
     * @param value The password for the master user. The password can include any printable ASCII character except "/", """, or "@". It cannot contain spaces.
     */
    @JvmName("xfvtusjejvtekogn")
    public suspend fun masterUserPassword(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.masterUserPassword = mapped
    }

    /**
     * @param value The name for the master user.
     */
    @JvmName("cjosufhfotcgnthr")
    public suspend fun masterUsername(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.masterUsername = mapped
    }

    /**
     * @param value The daily time range during which automated backups are created for your new database if automated backups are enabled.
     */
    @JvmName("sthavklhorsvycik")
    public suspend fun preferredBackupWindow(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preferredBackupWindow = mapped
    }

    /**
     * @param value The weekly time range during which system maintenance can occur on your new database.
     */
    @JvmName("rxmrcjnmieasroar")
    public suspend fun preferredMaintenanceWindow(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preferredMaintenanceWindow = mapped
    }

    /**
     * @param value Specifies the accessibility options for your new database. A value of true specifies a database that is available to resources outside of your Lightsail account. A value of false specifies a database that is available only to your Lightsail resources in the same region as your database.
     */
    @JvmName("yoaupmkjewajjliv")
    public suspend fun publiclyAccessible(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publiclyAccessible = mapped
    }

    /**
     * @param value The blueprint ID for your new database. A blueprint describes the major engine version of a database.
     */
    @JvmName("uwekessyqvcpaiwh")
    public suspend fun relationalDatabaseBlueprintId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relationalDatabaseBlueprintId = mapped
    }

    /**
     * @param value The bundle ID for your new database. A bundle describes the performance specifications for your database.
     */
    @JvmName("pujkmkdxccrakxhg")
    public suspend fun relationalDatabaseBundleId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relationalDatabaseBundleId = mapped
    }

    /**
     * @param value The name to use for your new Lightsail database resource.
     */
    @JvmName("qqyhetvnpvqcbmem")
    public suspend fun relationalDatabaseName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relationalDatabaseName = mapped
    }

    /**
     * @param value Update one or more parameters of the relational database.
     */
    @JvmName("pjrgwwhmsepsfjrs")
    public suspend fun relationalDatabaseParameters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relationalDatabaseParameters = mapped
    }

    /**
     * @param argument Update one or more parameters of the relational database.
     */
    @JvmName("egboyggvedttclyc")
    public suspend fun relationalDatabaseParameters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DatabaseRelationalDatabaseParameterArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.relationalDatabaseParameters = mapped
    }

    /**
     * @param argument Update one or more parameters of the relational database.
     */
    @JvmName("nsmraoabhpqlqjgc")
    public suspend fun relationalDatabaseParameters(vararg argument: suspend DatabaseRelationalDatabaseParameterArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DatabaseRelationalDatabaseParameterArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.relationalDatabaseParameters = mapped
    }

    /**
     * @param argument Update one or more parameters of the relational database.
     */
    @JvmName("pfvqslqktinmitgq")
    public suspend fun relationalDatabaseParameters(argument: suspend DatabaseRelationalDatabaseParameterArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            DatabaseRelationalDatabaseParameterArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.relationalDatabaseParameters = mapped
    }

    /**
     * @param values Update one or more parameters of the relational database.
     */
    @JvmName("yutyxakiovfhbkpe")
    public suspend fun relationalDatabaseParameters(vararg values: DatabaseRelationalDatabaseParameterArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.relationalDatabaseParameters = mapped
    }

    /**
     * @param value When true, the master user password is changed to a new strong password generated by Lightsail. Use the get relational database master user password operation to get the new password.
     */
    @JvmName("ooeyrsnxggjvjcxa")
    public suspend fun rotateMasterUserPassword(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rotateMasterUserPassword = mapped
    }

    /**
     * @param value An array of key-value pairs to apply to this resource.
     */
    @JvmName("luxsyflhflnpnipr")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to this resource.
     */
    @JvmName("scedjjfkjbkwgude")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to this resource.
     */
    @JvmName("gvpbmmqnavafppuw")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to this resource.
     */
    @JvmName("rcrwmlbegmqvmwbk")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values An array of key-value pairs to apply to this resource.
     */
    @JvmName("kaupswfhyowgrwkf")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): DatabaseArgs = DatabaseArgs(
        availabilityZone = availabilityZone,
        backupRetention = backupRetention,
        caCertificateIdentifier = caCertificateIdentifier,
        masterDatabaseName = masterDatabaseName,
        masterUserPassword = masterUserPassword,
        masterUsername = masterUsername,
        preferredBackupWindow = preferredBackupWindow,
        preferredMaintenanceWindow = preferredMaintenanceWindow,
        publiclyAccessible = publiclyAccessible,
        relationalDatabaseBlueprintId = relationalDatabaseBlueprintId,
        relationalDatabaseBundleId = relationalDatabaseBundleId,
        relationalDatabaseName = relationalDatabaseName,
        relationalDatabaseParameters = relationalDatabaseParameters,
        rotateMasterUserPassword = rotateMasterUserPassword,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy