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

com.pulumi.azure.mysql.kotlin.ConfigurationArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.mysql.kotlin

import com.pulumi.azure.mysql.ConfigurationArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Sets a MySQL Configuration value on a MySQL Server.
 * > **Note:** Azure Database for MySQL Single Server and its sub resources are scheduled for retirement by 2024-09-16 and will migrate to using Azure Database for MySQL Flexible Server: https://go.microsoft.com/fwlink/?linkid=2216041. The `azure.mysql.Configuration` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. Please use the `azure.mysql.FlexibleServerConfiguration` resource instead.
 * ## Disclaimers
 * > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleServer = new azure.mysql.Server("example", {
 *     name: "example-mysqlserver",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     administratorLogin: "mysqladminun",
 *     administratorLoginPassword: "H@Sh1CoR3!",
 *     skuName: "B_Gen5_2",
 *     storageMb: 5120,
 *     version: "5.7",
 *     autoGrowEnabled: true,
 *     backupRetentionDays: 7,
 *     geoRedundantBackupEnabled: true,
 *     infrastructureEncryptionEnabled: true,
 *     publicNetworkAccessEnabled: false,
 *     sslEnforcementEnabled: true,
 *     sslMinimalTlsVersionEnforced: "TLS1_2",
 * });
 * const exampleConfiguration = new azure.mysql.Configuration("example", {
 *     name: "interactive_timeout",
 *     resourceGroupName: example.name,
 *     serverName: exampleServer.name,
 *     value: "600",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_server = azure.mysql.Server("example",
 *     name="example-mysqlserver",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     administrator_login="mysqladminun",
 *     administrator_login_password="H@Sh1CoR3!",
 *     sku_name="B_Gen5_2",
 *     storage_mb=5120,
 *     version="5.7",
 *     auto_grow_enabled=True,
 *     backup_retention_days=7,
 *     geo_redundant_backup_enabled=True,
 *     infrastructure_encryption_enabled=True,
 *     public_network_access_enabled=False,
 *     ssl_enforcement_enabled=True,
 *     ssl_minimal_tls_version_enforced="TLS1_2")
 * example_configuration = azure.mysql.Configuration("example",
 *     name="interactive_timeout",
 *     resource_group_name=example.name,
 *     server_name=example_server.name,
 *     value="600")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleServer = new Azure.MySql.Server("example", new()
 *     {
 *         Name = "example-mysqlserver",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AdministratorLogin = "mysqladminun",
 *         AdministratorLoginPassword = "H@Sh1CoR3!",
 *         SkuName = "B_Gen5_2",
 *         StorageMb = 5120,
 *         Version = "5.7",
 *         AutoGrowEnabled = true,
 *         BackupRetentionDays = 7,
 *         GeoRedundantBackupEnabled = true,
 *         InfrastructureEncryptionEnabled = true,
 *         PublicNetworkAccessEnabled = false,
 *         SslEnforcementEnabled = true,
 *         SslMinimalTlsVersionEnforced = "TLS1_2",
 *     });
 *     var exampleConfiguration = new Azure.MySql.Configuration("example", new()
 *     {
 *         Name = "interactive_timeout",
 *         ResourceGroupName = example.Name,
 *         ServerName = exampleServer.Name,
 *         Value = "600",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleServer, err := mysql.NewServer(ctx, "example", &mysql.ServerArgs{
 * 			Name:                            pulumi.String("example-mysqlserver"),
 * 			Location:                        example.Location,
 * 			ResourceGroupName:               example.Name,
 * 			AdministratorLogin:              pulumi.String("mysqladminun"),
 * 			AdministratorLoginPassword:      pulumi.String("H@Sh1CoR3!"),
 * 			SkuName:                         pulumi.String("B_Gen5_2"),
 * 			StorageMb:                       pulumi.Int(5120),
 * 			Version:                         pulumi.String("5.7"),
 * 			AutoGrowEnabled:                 pulumi.Bool(true),
 * 			BackupRetentionDays:             pulumi.Int(7),
 * 			GeoRedundantBackupEnabled:       pulumi.Bool(true),
 * 			InfrastructureEncryptionEnabled: pulumi.Bool(true),
 * 			PublicNetworkAccessEnabled:      pulumi.Bool(false),
 * 			SslEnforcementEnabled:           pulumi.Bool(true),
 * 			SslMinimalTlsVersionEnforced:    pulumi.String("TLS1_2"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = mysql.NewConfiguration(ctx, "example", &mysql.ConfigurationArgs{
 * 			Name:              pulumi.String("interactive_timeout"),
 * 			ResourceGroupName: example.Name,
 * 			ServerName:        exampleServer.Name,
 * 			Value:             pulumi.String("600"),
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.mysql.Server;
 * import com.pulumi.azure.mysql.ServerArgs;
 * import com.pulumi.azure.mysql.Configuration;
 * import com.pulumi.azure.mysql.ConfigurationArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleServer = new Server("exampleServer", ServerArgs.builder()
 *             .name("example-mysqlserver")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .administratorLogin("mysqladminun")
 *             .administratorLoginPassword("H@Sh1CoR3!")
 *             .skuName("B_Gen5_2")
 *             .storageMb(5120)
 *             .version("5.7")
 *             .autoGrowEnabled(true)
 *             .backupRetentionDays(7)
 *             .geoRedundantBackupEnabled(true)
 *             .infrastructureEncryptionEnabled(true)
 *             .publicNetworkAccessEnabled(false)
 *             .sslEnforcementEnabled(true)
 *             .sslMinimalTlsVersionEnforced("TLS1_2")
 *             .build());
 *         var exampleConfiguration = new Configuration("exampleConfiguration", ConfigurationArgs.builder()
 *             .name("interactive_timeout")
 *             .resourceGroupName(example.name())
 *             .serverName(exampleServer.name())
 *             .value("600")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleServer:
 *     type: azure:mysql:Server
 *     name: example
 *     properties:
 *       name: example-mysqlserver
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       administratorLogin: mysqladminun
 *       administratorLoginPassword: H@Sh1CoR3!
 *       skuName: B_Gen5_2
 *       storageMb: 5120
 *       version: '5.7'
 *       autoGrowEnabled: true
 *       backupRetentionDays: 7
 *       geoRedundantBackupEnabled: true
 *       infrastructureEncryptionEnabled: true
 *       publicNetworkAccessEnabled: false
 *       sslEnforcementEnabled: true
 *       sslMinimalTlsVersionEnforced: TLS1_2
 *   exampleConfiguration:
 *     type: azure:mysql:Configuration
 *     name: example
 *     properties:
 *       name: interactive_timeout
 *       resourceGroupName: ${example.name}
 *       serverName: ${exampleServer.name}
 *       value: '600'
 * ```
 * 
 * ## Import
 * MySQL Configurations can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:mysql/configuration:Configuration interactive_timeout /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMySQL/servers/server1/configurations/interactive_timeout
 * ```
 * @property name Specifies the name of the MySQL Configuration, which needs [to be a valid MySQL configuration name](https://dev.mysql.com/doc/refman/5.7/en/server-configuration.html). Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which the MySQL Server exists. Changing this forces a new resource to be created.
 * @property serverName Specifies the name of the MySQL Server. Changing this forces a new resource to be created.
 * @property value Specifies the value of the MySQL Configuration. See the MySQL documentation for valid values. Changing this forces a new resource to be created.
 */
public data class ConfigurationArgs(
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val `value`: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.mysql.ConfigurationArgs =
        com.pulumi.azure.mysql.ConfigurationArgs.builder()
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .`value`(`value`?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ConfigurationArgs].
 */
@PulumiTagMarker
public class ConfigurationArgsBuilder internal constructor() {
    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var `value`: Output? = null

    /**
     * @param value Specifies the name of the MySQL Configuration, which needs [to be a valid MySQL configuration name](https://dev.mysql.com/doc/refman/5.7/en/server-configuration.html). Changing this forces a new resource to be created.
     */
    @JvmName("hllhounfmxkdrpcl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the resource group in which the MySQL Server exists. Changing this forces a new resource to be created.
     */
    @JvmName("csrupylohvvokxrc")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the name of the MySQL Server. Changing this forces a new resource to be created.
     */
    @JvmName("tbmbuuxiarupawxw")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

    /**
     * @param value Specifies the value of the MySQL Configuration. See the MySQL documentation for valid values. Changing this forces a new resource to be created.
     */
    @JvmName("mqhtkqwcclweirph")
    public suspend fun `value`(`value`: Output) {
        this.`value` = value
    }

    /**
     * @param value Specifies the name of the MySQL Configuration, which needs [to be a valid MySQL configuration name](https://dev.mysql.com/doc/refman/5.7/en/server-configuration.html). Changing this forces a new resource to be created.
     */
    @JvmName("oikjryksbxcyjdkr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the resource group in which the MySQL Server exists. Changing this forces a new resource to be created.
     */
    @JvmName("umtxnbhcagvykhyt")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Specifies the name of the MySQL Server. Changing this forces a new resource to be created.
     */
    @JvmName("eahwhfswyohoelcy")
    public suspend fun serverName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverName = mapped
    }

    /**
     * @param value Specifies the value of the MySQL Configuration. See the MySQL documentation for valid values. Changing this forces a new resource to be created.
     */
    @JvmName("iwwbcpddqtdlwent")
    public suspend fun `value`(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`value` = mapped
    }

    internal fun build(): ConfigurationArgs = ConfigurationArgs(
        name = name,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        `value` = `value`,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy