com.pulumi.digitalocean.kotlin.DatabaseMysqlConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-digitalocean-kotlin Show documentation
Show all versions of pulumi-digitalocean-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.digitalocean.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.Boolean
import kotlin.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [DatabaseMysqlConfig].
*/
@PulumiTagMarker
public class DatabaseMysqlConfigResourceBuilder internal constructor() {
public var name: String? = null
public var args: DatabaseMysqlConfigArgs = DatabaseMysqlConfigArgs()
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 DatabaseMysqlConfigArgsBuilder.() -> Unit) {
val builder = DatabaseMysqlConfigArgsBuilder()
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(): DatabaseMysqlConfig {
val builtJavaResource = com.pulumi.digitalocean.DatabaseMysqlConfig(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DatabaseMysqlConfig(builtJavaResource)
}
}
/**
* Provides a virtual resource that can be used to change advanced configuration
* options for a DigitalOcean managed MySQL database cluster.
* > **Note** MySQL configurations are only removed from state when destroyed. The remote configuration is not unset.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
* const exampleDatabaseCluster = new digitalocean.DatabaseCluster("example", {
* name: "example-mysql-cluster",
* engine: "mysql",
* version: "8",
* size: digitalocean.DatabaseSlug.DB_1VPCU1GB,
* region: digitalocean.Region.NYC1,
* nodeCount: 1,
* });
* const example = new digitalocean.DatabaseMysqlConfig("example", {
* clusterId: exampleDatabaseCluster.id,
* connectTimeout: 10,
* defaultTimeZone: "UTC",
* });
* ```
* ```python
* import pulumi
* import pulumi_digitalocean as digitalocean
* example_database_cluster = digitalocean.DatabaseCluster("example",
* name="example-mysql-cluster",
* engine="mysql",
* version="8",
* size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
* region=digitalocean.Region.NYC1,
* node_count=1)
* example = digitalocean.DatabaseMysqlConfig("example",
* cluster_id=example_database_cluster.id,
* connect_timeout=10,
* default_time_zone="UTC")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using DigitalOcean = Pulumi.DigitalOcean;
* return await Deployment.RunAsync(() =>
* {
* var exampleDatabaseCluster = new DigitalOcean.DatabaseCluster("example", new()
* {
* Name = "example-mysql-cluster",
* Engine = "mysql",
* Version = "8",
* Size = DigitalOcean.DatabaseSlug.DB_1VPCU1GB,
* Region = DigitalOcean.Region.NYC1,
* NodeCount = 1,
* });
* var example = new DigitalOcean.DatabaseMysqlConfig("example", new()
* {
* ClusterId = exampleDatabaseCluster.Id,
* ConnectTimeout = 10,
* DefaultTimeZone = "UTC",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* exampleDatabaseCluster, err := digitalocean.NewDatabaseCluster(ctx, "example", &digitalocean.DatabaseClusterArgs{
* Name: pulumi.String("example-mysql-cluster"),
* Engine: pulumi.String("mysql"),
* Version: pulumi.String("8"),
* Size: pulumi.String(digitalocean.DatabaseSlug_DB_1VPCU1GB),
* Region: pulumi.String(digitalocean.RegionNYC1),
* NodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* _, err = digitalocean.NewDatabaseMysqlConfig(ctx, "example", &digitalocean.DatabaseMysqlConfigArgs{
* ClusterId: exampleDatabaseCluster.ID(),
* ConnectTimeout: pulumi.Int(10),
* DefaultTimeZone: pulumi.String("UTC"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.digitalocean.DatabaseCluster;
* import com.pulumi.digitalocean.DatabaseClusterArgs;
* import com.pulumi.digitalocean.DatabaseMysqlConfig;
* import com.pulumi.digitalocean.DatabaseMysqlConfigArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var exampleDatabaseCluster = new DatabaseCluster("exampleDatabaseCluster", DatabaseClusterArgs.builder()
* .name("example-mysql-cluster")
* .engine("mysql")
* .version("8")
* .size("db-s-1vcpu-1gb")
* .region("nyc1")
* .nodeCount(1)
* .build());
* var example = new DatabaseMysqlConfig("example", DatabaseMysqlConfigArgs.builder()
* .clusterId(exampleDatabaseCluster.id())
* .connectTimeout(10)
* .defaultTimeZone("UTC")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: digitalocean:DatabaseMysqlConfig
* properties:
* clusterId: ${exampleDatabaseCluster.id}
* connectTimeout: 10
* defaultTimeZone: UTC
* exampleDatabaseCluster:
* type: digitalocean:DatabaseCluster
* name: example
* properties:
* name: example-mysql-cluster
* engine: mysql
* version: '8'
* size: db-s-1vcpu-1gb
* region: nyc1
* nodeCount: 1
* ```
*
* ## Import
* A MySQL database cluster's configuration can be imported using the `id` the parent cluster, e.g.
* ```sh
* $ pulumi import digitalocean:index/databaseMysqlConfig:DatabaseMysqlConfig example 4b62829a-9c42-465b-aaa3-84051048e712
* ```
*/
public class DatabaseMysqlConfig internal constructor(
override val javaResource: com.pulumi.digitalocean.DatabaseMysqlConfig,
) : KotlinCustomResource(javaResource, DatabaseMysqlConfigMapper) {
/**
* The hour of day (in UTC) when backup for the service starts. New backup only starts if previous backup has already completed.
*/
public val backupHour: Output
get() = javaResource.backupHour().applyValue({ args0 -> args0 })
/**
* The minute of the backup hour when backup for the service starts. New backup only starts if previous backup has already completed.
*/
public val backupMinute: Output
get() = javaResource.backupMinute().applyValue({ args0 -> args0 })
/**
* The minimum amount of time, in seconds, to keep binlog entries before deletion. This may be extended for services that require binlog entries for longer than the default, for example if using the MySQL Debezium Kafka connector.
*/
public val binlogRetentionPeriod: Output
get() = javaResource.binlogRetentionPeriod().applyValue({ args0 -> args0 })
/**
* The ID of the target MySQL cluster.
*/
public val clusterId: Output
get() = javaResource.clusterId().applyValue({ args0 -> args0 })
/**
* The number of seconds that the mysqld server waits for a connect packet before responding with bad handshake.
*/
public val connectTimeout: Output
get() = javaResource.connectTimeout().applyValue({ args0 -> args0 })
/**
* Default server time zone, in the form of an offset from UTC (from -12:00 to +12:00), a time zone name (EST), or `SYSTEM` to use the MySQL server default.
*/
public val defaultTimeZone: Output
get() = javaResource.defaultTimeZone().applyValue({ args0 -> args0 })
/**
* The maximum permitted result length, in bytes, for the `GROUP_CONCAT()` function.
*/
public val groupConcatMaxLen: Output
get() = javaResource.groupConcatMaxLen().applyValue({ args0 -> args0 })
/**
* The time, in seconds, before cached statistics expire.
*/
public val informationSchemaStatsExpiry: Output
get() = javaResource.informationSchemaStatsExpiry().applyValue({ args0 -> args0 })
/**
* The minimum length of words that an InnoDB FULLTEXT index stores.
*/
public val innodbFtMinTokenSize: Output
get() = javaResource.innodbFtMinTokenSize().applyValue({ args0 -> args0 })
/**
* The InnoDB FULLTEXT index stopword list for all InnoDB tables.
*/
public val innodbFtServerStopwordTable: Output
get() = javaResource.innodbFtServerStopwordTable().applyValue({ args0 -> args0 })
/**
* The time, in seconds, that an InnoDB transaction waits for a row lock. before giving up.
*/
public val innodbLockWaitTimeout: Output
get() = javaResource.innodbLockWaitTimeout().applyValue({ args0 -> args0 })
/**
* The size of the buffer, in bytes, that InnoDB uses to write to the log files. on disk.
*/
public val innodbLogBufferSize: Output
get() = javaResource.innodbLogBufferSize().applyValue({ args0 -> args0 })
/**
* The upper limit, in bytes, of the size of the temporary log files used during online DDL operations for InnoDB tables.
*/
public val innodbOnlineAlterLogMaxSize: Output
get() = javaResource.innodbOnlineAlterLogMaxSize().applyValue({ args0 -> args0 })
/**
* When enabled, records information about all deadlocks in InnoDB user transactions in the error log. Disabled by default.
*/
public val innodbPrintAllDeadlocks: Output
get() = javaResource.innodbPrintAllDeadlocks().applyValue({ args0 -> args0 })
/**
* When enabled, transaction timeouts cause InnoDB to abort and roll back the entire transaction.
*/
public val innodbRollbackOnTimeout: Output
get() = javaResource.innodbRollbackOnTimeout().applyValue({ args0 -> args0 })
/**
* The time, in seconds, the server waits for activity on an interactive. connection before closing it.
*/
public val interactiveTimeout: Output
get() = javaResource.interactiveTimeout().applyValue({ args0 -> args0 })
/**
* The storage engine for in-memory internal temporary tables. Supported values are: `TempTable`, `MEMORY`.
*/
public val internalTmpMemStorageEngine: Output
get() = javaResource.internalTmpMemStorageEngine().applyValue({ args0 -> args0 })
/**
* The time, in seconds, for a query to take to execute before being captured by `slow_query_logs`. Default is `10` seconds.
*/
public val longQueryTime: Output
get() = javaResource.longQueryTime().applyValue({ args0 -> args0 })
/**
* The size of the largest message, in bytes, that can be received by the server. Default is `67108864` (64M).
*/
public val maxAllowedPacket: Output
get() = javaResource.maxAllowedPacket().applyValue({ args0 -> args0 })
/**
* The maximum size, in bytes, of internal in-memory tables. Also set `tmp_table_size`. Default is `16777216` (16M)
*/
public val maxHeapTableSize: Output
get() = javaResource.maxHeapTableSize().applyValue({ args0 -> args0 })
/**
* The time, in seconds, to wait for more data from an existing connection. aborting the read.
*/
public val netReadTimeout: Output
get() = javaResource.netReadTimeout().applyValue({ args0 -> args0 })
/**
* The number of seconds to wait for a block to be written to a connection before aborting the write.
*/
public val netWriteTimeout: Output
get() = javaResource.netWriteTimeout().applyValue({ args0 -> args0 })
/**
* When enabled, captures slow queries. When disabled, also truncates the mysql.slow_log table. Default is false.
*/
public val slowQueryLog: Output
get() = javaResource.slowQueryLog().applyValue({ args0 -> args0 })
/**
* The sort buffer size, in bytes, for `ORDER BY` optimization. Default is `262144`. (256K).
*/
public val sortBufferSize: Output
get() = javaResource.sortBufferSize().applyValue({ args0 -> args0 })
/**
* Global SQL mode. If empty, uses MySQL server defaults. Must only include uppercase alphabetic characters, underscores, and commas.
*/
public val sqlMode: Output
get() = javaResource.sqlMode().applyValue({ args0 -> args0 })
/**
* Require primary key to be defined for new tables or old tables modified with ALTER TABLE and fail if missing. It is recommended to always have primary keys because various functionality may break if any large table is missing them.
*/
public val sqlRequirePrimaryKey: Output
get() = javaResource.sqlRequirePrimaryKey().applyValue({ args0 -> args0 })
/**
* The maximum size, in bytes, of internal in-memory tables. Also set `max_heap_table_size`. Default is `16777216` (16M).
*/
public val tmpTableSize: Output
get() = javaResource.tmpTableSize().applyValue({ args0 -> args0 })
/**
* The number of seconds the server waits for activity on a noninteractive connection before closing it.
*/
public val waitTimeout: Output
get() = javaResource.waitTimeout().applyValue({ args0 -> args0 })
}
public object DatabaseMysqlConfigMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.digitalocean.DatabaseMysqlConfig::class == javaResource::class
override fun map(javaResource: Resource): DatabaseMysqlConfig = DatabaseMysqlConfig(
javaResource
as com.pulumi.digitalocean.DatabaseMysqlConfig,
)
}
/**
* @see [DatabaseMysqlConfig].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [DatabaseMysqlConfig].
*/
public suspend fun databaseMysqlConfig(
name: String,
block: suspend DatabaseMysqlConfigResourceBuilder.() -> Unit,
): DatabaseMysqlConfig {
val builder = DatabaseMysqlConfigResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [DatabaseMysqlConfig].
* @param name The _unique_ name of the resulting resource.
*/
public fun databaseMysqlConfig(name: String): DatabaseMysqlConfig {
val builder = DatabaseMysqlConfigResourceBuilder()
builder.name(name)
return builder.build()
}