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

com.pulumi.gcp.sql.kotlin.inputs.DatabaseInstanceSettingsIpConfigurationArgs.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.sql.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsIpConfigurationArgs.builder
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

/**
 *
 * @property allocatedIpRange The name of the allocated ip range for the private ip CloudSQL instance. For example: "google-managed-services-default". If set, the instance ip will be created in the allocated range. The range name must comply with [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035). Specifically, the name must be 1-63 characters long and match the regular expression a-z?.
 * @property authorizedNetworks
 * @property enablePrivatePathForGoogleCloudServices Whether Google Cloud services such as BigQuery are allowed to access data in this Cloud SQL instance over a private IP connection. SQLSERVER database type is not supported.
 * @property ipv4Enabled Whether this Cloud SQL instance should be assigned
 * a public IPV4 address. At least `ipv4_enabled` must be enabled or a
 * `private_network` must be configured.
 * @property privateNetwork The VPC network from which the Cloud SQL
 * instance is accessible for private IP. For example, projects/myProject/global/networks/default.
 * Specifying a network enables private IP.
 * At least `ipv4_enabled` must be enabled or a `private_network` must be configured.
 * This setting can be updated, but it cannot be removed after it is set.
 * @property pscConfigs PSC settings for a Cloud SQL instance.
 * @property requireSsl Whether SSL connections over IP are enforced or not. To change this field, also set the corresponding value in `ssl_mode`.
 * @property sslMode Specify how SSL connection should be enforced in DB connections. This field provides more SSL enforcment options compared to `require_ssl`. To change this field, also set the correspoding value in `require_ssl`.
 * * For PostgreSQL instances, the value pairs are listed in the [API reference doc](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration) for `ssl_mode` field.
 * * For MySQL instances, use the same value pairs as the PostgreSQL instances.
 * * For SQL Server instances, set it to `ALLOW_UNENCRYPTED_AND_ENCRYPTED` when `require_ssl=false` and `ENCRYPTED_ONLY` otherwise.
 */
public data class DatabaseInstanceSettingsIpConfigurationArgs(
    public val allocatedIpRange: Output? = null,
    public val authorizedNetworks: Output>? = null,
    public val enablePrivatePathForGoogleCloudServices: Output? = null,
    public val ipv4Enabled: Output? = null,
    public val privateNetwork: Output? = null,
    public val pscConfigs: Output>? = null,
    public val requireSsl: Output? = null,
    public val sslMode: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsIpConfigurationArgs =
        com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsIpConfigurationArgs.builder()
            .allocatedIpRange(allocatedIpRange?.applyValue({ args0 -> args0 }))
            .authorizedNetworks(
                authorizedNetworks?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .enablePrivatePathForGoogleCloudServices(
                enablePrivatePathForGoogleCloudServices?.applyValue({ args0 ->
                    args0
                }),
            )
            .ipv4Enabled(ipv4Enabled?.applyValue({ args0 -> args0 }))
            .privateNetwork(privateNetwork?.applyValue({ args0 -> args0 }))
            .pscConfigs(
                pscConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .requireSsl(requireSsl?.applyValue({ args0 -> args0 }))
            .sslMode(sslMode?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DatabaseInstanceSettingsIpConfigurationArgs].
 */
@PulumiTagMarker
public class DatabaseInstanceSettingsIpConfigurationArgsBuilder internal constructor() {
    private var allocatedIpRange: Output? = null

    private var authorizedNetworks:
        Output>? = null

    private var enablePrivatePathForGoogleCloudServices: Output? = null

    private var ipv4Enabled: Output? = null

    private var privateNetwork: Output? = null

    private var pscConfigs: Output>? = null

    private var requireSsl: Output? = null

    private var sslMode: Output? = null

    /**
     * @param value The name of the allocated ip range for the private ip CloudSQL instance. For example: "google-managed-services-default". If set, the instance ip will be created in the allocated range. The range name must comply with [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035). Specifically, the name must be 1-63 characters long and match the regular expression a-z?.
     */
    @JvmName("pmvitstkkxsjepva")
    public suspend fun allocatedIpRange(`value`: Output) {
        this.allocatedIpRange = value
    }

    /**
     * @param value
     */
    @JvmName("ctqedabopjntnevo")
    public suspend fun authorizedNetworks(`value`: Output>) {
        this.authorizedNetworks = value
    }

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

    /**
     * @param values
     */
    @JvmName("echyjpnohfrgqckw")
    public suspend fun authorizedNetworks(values: List>) {
        this.authorizedNetworks = Output.all(values)
    }

    /**
     * @param value Whether Google Cloud services such as BigQuery are allowed to access data in this Cloud SQL instance over a private IP connection. SQLSERVER database type is not supported.
     */
    @JvmName("facpxgfncyajcnsw")
    public suspend fun enablePrivatePathForGoogleCloudServices(`value`: Output) {
        this.enablePrivatePathForGoogleCloudServices = value
    }

    /**
     * @param value Whether this Cloud SQL instance should be assigned
     * a public IPV4 address. At least `ipv4_enabled` must be enabled or a
     * `private_network` must be configured.
     */
    @JvmName("hwmxcojgbtxydiec")
    public suspend fun ipv4Enabled(`value`: Output) {
        this.ipv4Enabled = value
    }

    /**
     * @param value The VPC network from which the Cloud SQL
     * instance is accessible for private IP. For example, projects/myProject/global/networks/default.
     * Specifying a network enables private IP.
     * At least `ipv4_enabled` must be enabled or a `private_network` must be configured.
     * This setting can be updated, but it cannot be removed after it is set.
     */
    @JvmName("ygepmkfnuutmdmdu")
    public suspend fun privateNetwork(`value`: Output) {
        this.privateNetwork = value
    }

    /**
     * @param value PSC settings for a Cloud SQL instance.
     */
    @JvmName("clqethijqigfyvws")
    public suspend fun pscConfigs(`value`: Output>) {
        this.pscConfigs = value
    }

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

    /**
     * @param values PSC settings for a Cloud SQL instance.
     */
    @JvmName("fijxcdfriqxemglg")
    public suspend fun pscConfigs(values: List>) {
        this.pscConfigs = Output.all(values)
    }

    /**
     * @param value Whether SSL connections over IP are enforced or not. To change this field, also set the corresponding value in `ssl_mode`.
     */
    @JvmName("majhsohlppywlmgp")
    public suspend fun requireSsl(`value`: Output) {
        this.requireSsl = value
    }

    /**
     * @param value Specify how SSL connection should be enforced in DB connections. This field provides more SSL enforcment options compared to `require_ssl`. To change this field, also set the correspoding value in `require_ssl`.
     * * For PostgreSQL instances, the value pairs are listed in the [API reference doc](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration) for `ssl_mode` field.
     * * For MySQL instances, use the same value pairs as the PostgreSQL instances.
     * * For SQL Server instances, set it to `ALLOW_UNENCRYPTED_AND_ENCRYPTED` when `require_ssl=false` and `ENCRYPTED_ONLY` otherwise.
     */
    @JvmName("gttxoxcacjmtuuqr")
    public suspend fun sslMode(`value`: Output) {
        this.sslMode = value
    }

    /**
     * @param value The name of the allocated ip range for the private ip CloudSQL instance. For example: "google-managed-services-default". If set, the instance ip will be created in the allocated range. The range name must comply with [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035). Specifically, the name must be 1-63 characters long and match the regular expression a-z?.
     */
    @JvmName("wgbmpopuswoigjjn")
    public suspend fun allocatedIpRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allocatedIpRange = mapped
    }

    /**
     * @param value
     */
    @JvmName("lxgvbrxabtlmcpru")
    public suspend fun authorizedNetworks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authorizedNetworks = mapped
    }

    /**
     * @param argument
     */
    @JvmName("xrppvhwmcckqdasg")
    public suspend fun authorizedNetworks(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.authorizedNetworks = mapped
    }

    /**
     * @param argument
     */
    @JvmName("ddomubovyuhkprie")
    public suspend fun authorizedNetworks(vararg argument: suspend DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.authorizedNetworks = mapped
    }

    /**
     * @param argument
     */
    @JvmName("ajjixpisgeqhmbwt")
    public suspend fun authorizedNetworks(argument: suspend DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.authorizedNetworks = mapped
    }

    /**
     * @param values
     */
    @JvmName("jmifjuwtvdmmguil")
    public suspend fun authorizedNetworks(vararg values: DatabaseInstanceSettingsIpConfigurationAuthorizedNetworkArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.authorizedNetworks = mapped
    }

    /**
     * @param value Whether Google Cloud services such as BigQuery are allowed to access data in this Cloud SQL instance over a private IP connection. SQLSERVER database type is not supported.
     */
    @JvmName("rnvprcywqxpydybq")
    public suspend fun enablePrivatePathForGoogleCloudServices(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enablePrivatePathForGoogleCloudServices = mapped
    }

    /**
     * @param value Whether this Cloud SQL instance should be assigned
     * a public IPV4 address. At least `ipv4_enabled` must be enabled or a
     * `private_network` must be configured.
     */
    @JvmName("cfcucqgmuvivsrjh")
    public suspend fun ipv4Enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipv4Enabled = mapped
    }

    /**
     * @param value The VPC network from which the Cloud SQL
     * instance is accessible for private IP. For example, projects/myProject/global/networks/default.
     * Specifying a network enables private IP.
     * At least `ipv4_enabled` must be enabled or a `private_network` must be configured.
     * This setting can be updated, but it cannot be removed after it is set.
     */
    @JvmName("sskgjjvgnlpcurqe")
    public suspend fun privateNetwork(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.privateNetwork = mapped
    }

    /**
     * @param value PSC settings for a Cloud SQL instance.
     */
    @JvmName("hrjclnqeokjhvftm")
    public suspend fun pscConfigs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pscConfigs = mapped
    }

    /**
     * @param argument PSC settings for a Cloud SQL instance.
     */
    @JvmName("isfhyaxbqtypelny")
    public suspend fun pscConfigs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DatabaseInstanceSettingsIpConfigurationPscConfigArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.pscConfigs = mapped
    }

    /**
     * @param argument PSC settings for a Cloud SQL instance.
     */
    @JvmName("sqhwveqfateoiwit")
    public suspend fun pscConfigs(vararg argument: suspend DatabaseInstanceSettingsIpConfigurationPscConfigArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DatabaseInstanceSettingsIpConfigurationPscConfigArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.pscConfigs = mapped
    }

    /**
     * @param argument PSC settings for a Cloud SQL instance.
     */
    @JvmName("epiojwofmfwqpeao")
    public suspend fun pscConfigs(argument: suspend DatabaseInstanceSettingsIpConfigurationPscConfigArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                DatabaseInstanceSettingsIpConfigurationPscConfigArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.pscConfigs = mapped
    }

    /**
     * @param values PSC settings for a Cloud SQL instance.
     */
    @JvmName("uvcwdfrvygeodsxc")
    public suspend fun pscConfigs(vararg values: DatabaseInstanceSettingsIpConfigurationPscConfigArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.pscConfigs = mapped
    }

    /**
     * @param value Whether SSL connections over IP are enforced or not. To change this field, also set the corresponding value in `ssl_mode`.
     */
    @JvmName("qdpariyqdehdkkvo")
    public suspend fun requireSsl(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requireSsl = mapped
    }

    /**
     * @param value Specify how SSL connection should be enforced in DB connections. This field provides more SSL enforcment options compared to `require_ssl`. To change this field, also set the correspoding value in `require_ssl`.
     * * For PostgreSQL instances, the value pairs are listed in the [API reference doc](https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration) for `ssl_mode` field.
     * * For MySQL instances, use the same value pairs as the PostgreSQL instances.
     * * For SQL Server instances, set it to `ALLOW_UNENCRYPTED_AND_ENCRYPTED` when `require_ssl=false` and `ENCRYPTED_ONLY` otherwise.
     */
    @JvmName("pjpyaegnokpfshyp")
    public suspend fun sslMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sslMode = mapped
    }

    internal fun build(): DatabaseInstanceSettingsIpConfigurationArgs =
        DatabaseInstanceSettingsIpConfigurationArgs(
            allocatedIpRange = allocatedIpRange,
            authorizedNetworks = authorizedNetworks,
            enablePrivatePathForGoogleCloudServices = enablePrivatePathForGoogleCloudServices,
            ipv4Enabled = ipv4Enabled,
            privateNetwork = privateNetwork,
            pscConfigs = pscConfigs,
            requireSsl = requireSsl,
            sslMode = sslMode,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy