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

com.pulumi.aws.rds.kotlin.ParameterGroupArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.rds.kotlin

import com.pulumi.aws.rds.ParameterGroupArgs.builder
import com.pulumi.aws.rds.kotlin.inputs.ParameterGroupParameterArgs
import com.pulumi.aws.rds.kotlin.inputs.ParameterGroupParameterArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides an RDS DB parameter group resource. Documentation of the available parameters for various RDS engines can be found at:
 * * [Aurora MySQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Reference.html)
 * * [Aurora PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraPostgreSQL.Reference.html)
 * * [MariaDB Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MariaDB.Parameters.html)
 * * [Oracle Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ModifyInstance.Oracle.html#USER_ModifyInstance.Oracle.sqlnet)
 * * [PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.Parameters)
 * > **Hands-on:** For an example of the `aws.rds.ParameterGroup` in use, follow the Manage AWS RDS Instances tutorial on HashiCorp Learn.
 * > **NOTE**: to make diffs less confusing, the AWS provider will ignore changes for a `parameter` whose `value` remains
 * unchanged but whose `apply_method` is changing (e.g., from `immediate` to `pending-reboot`, or `pending-reboot` to
 * `immediate`). This matches the cloud: if only the apply method of a parameter is changing, the AWS API will not register
 * this change. To change the `apply_method` of a parameter, its value must also change.
 * ## Example Usage
 * ### Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const _default = new aws.rds.ParameterGroup("default", {
 *     name: "rds-pg",
 *     family: "mysql5.6",
 *     parameters: [
 *         {
 *             name: "character_set_server",
 *             value: "utf8",
 *         },
 *         {
 *             name: "character_set_client",
 *             value: "utf8",
 *         },
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * default = aws.rds.ParameterGroup("default",
 *     name="rds-pg",
 *     family="mysql5.6",
 *     parameters=[
 *         {
 *             "name": "character_set_server",
 *             "value": "utf8",
 *         },
 *         {
 *             "name": "character_set_client",
 *             "value": "utf8",
 *         },
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Aws.Rds.ParameterGroup("default", new()
 *     {
 *         Name = "rds-pg",
 *         Family = "mysql5.6",
 *         Parameters = new[]
 *         {
 *             new Aws.Rds.Inputs.ParameterGroupParameterArgs
 *             {
 *                 Name = "character_set_server",
 *                 Value = "utf8",
 *             },
 *             new Aws.Rds.Inputs.ParameterGroupParameterArgs
 *             {
 *                 Name = "character_set_client",
 *                 Value = "utf8",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/rds"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := rds.NewParameterGroup(ctx, "default", &rds.ParameterGroupArgs{
 * 			Name:   pulumi.String("rds-pg"),
 * 			Family: pulumi.String("mysql5.6"),
 * 			Parameters: rds.ParameterGroupParameterArray{
 * 				&rds.ParameterGroupParameterArgs{
 * 					Name:  pulumi.String("character_set_server"),
 * 					Value: pulumi.String("utf8"),
 * 				},
 * 				&rds.ParameterGroupParameterArgs{
 * 					Name:  pulumi.String("character_set_client"),
 * 					Value: pulumi.String("utf8"),
 * 				},
 * 			},
 * 		})
 * 		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.aws.rds.ParameterGroup;
 * import com.pulumi.aws.rds.ParameterGroupArgs;
 * import com.pulumi.aws.rds.inputs.ParameterGroupParameterArgs;
 * 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 default_ = new ParameterGroup("default", ParameterGroupArgs.builder()
 *             .name("rds-pg")
 *             .family("mysql5.6")
 *             .parameters(
 *                 ParameterGroupParameterArgs.builder()
 *                     .name("character_set_server")
 *                     .value("utf8")
 *                     .build(),
 *                 ParameterGroupParameterArgs.builder()
 *                     .name("character_set_client")
 *                     .value("utf8")
 *                     .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: aws:rds:ParameterGroup
 *     properties:
 *       name: rds-pg
 *       family: mysql5.6
 *       parameters:
 *         - name: character_set_server
 *           value: utf8
 *         - name: character_set_client
 *           value: utf8
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import DB Parameter groups using the `name`. For example:
 * ```sh
 * $ pulumi import aws:rds/parameterGroup:ParameterGroup rds_pg rds-pg
 * ```
 * @property description The description of the DB parameter group. Defaults to "Managed by Pulumi".
 * @property family The family of the DB parameter group.
 * @property name The name of the DB parameter group. If omitted, this provider will assign a random, unique name.
 * @property namePrefix Creates a unique name beginning with the specified prefix. Conflicts with `name`.
 * @property parameters The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
 * @property skipDestroy
 * @property tags A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 */
public data class ParameterGroupArgs(
    public val description: Output? = null,
    public val family: Output? = null,
    public val name: Output? = null,
    public val namePrefix: Output? = null,
    public val parameters: Output>? = null,
    public val skipDestroy: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.rds.ParameterGroupArgs =
        com.pulumi.aws.rds.ParameterGroupArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .family(family?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .parameters(
                parameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .skipDestroy(skipDestroy?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ParameterGroupArgs].
 */
@PulumiTagMarker
public class ParameterGroupArgsBuilder internal constructor() {
    private var description: Output? = null

    private var family: Output? = null

    private var name: Output? = null

    private var namePrefix: Output? = null

    private var parameters: Output>? = null

    private var skipDestroy: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The description of the DB parameter group. Defaults to "Managed by Pulumi".
     */
    @JvmName("suvraadfuispqbvb")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The family of the DB parameter group.
     */
    @JvmName("eakkpowbxpybhyhn")
    public suspend fun family(`value`: Output) {
        this.family = value
    }

    /**
     * @param value The name of the DB parameter group. If omitted, this provider will assign a random, unique name.
     */
    @JvmName("xmsouxmsoksxxkek")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`.
     */
    @JvmName("pwwiocxaktcrvtkk")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("yftgnbepwurperap")
    public suspend fun parameters(`value`: Output>) {
        this.parameters = value
    }

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

    /**
     * @param values The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("sgeweigonmnkarpf")
    public suspend fun parameters(values: List>) {
        this.parameters = Output.all(values)
    }

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

    /**
     * @param value A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("rvwmvxuekysbvhqm")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The description of the DB parameter group. Defaults to "Managed by Pulumi".
     */
    @JvmName("diuiyyqfwxpcqcll")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The family of the DB parameter group.
     */
    @JvmName("csnhjiyffvsqwcyj")
    public suspend fun family(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.family = mapped
    }

    /**
     * @param value The name of the DB parameter group. If omitted, this provider will assign a random, unique name.
     */
    @JvmName("fkeberqrmofpubui")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Creates a unique name beginning with the specified prefix. Conflicts with `name`.
     */
    @JvmName("cdxjouwsixjnvhko")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("iiucbwwqcbbjsboo")
    public suspend fun parameters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param argument The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("yqybpxwjvkugrkwn")
    public suspend fun parameters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ParameterGroupParameterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.parameters = mapped
    }

    /**
     * @param argument The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("shhvcnypscsccewa")
    public suspend fun parameters(vararg argument: suspend ParameterGroupParameterArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ParameterGroupParameterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.parameters = mapped
    }

    /**
     * @param argument The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("ehiqofwgrqwtgggc")
    public suspend fun parameters(argument: suspend ParameterGroupParameterArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ParameterGroupParameterArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.parameters = mapped
    }

    /**
     * @param values The DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
     */
    @JvmName("maprcmixsilxqfkh")
    public suspend fun parameters(vararg values: ParameterGroupParameterArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

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

    /**
     * @param value A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("jbamhfhcfjatyrki")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("ikirvwqwonnkvcks")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ParameterGroupArgs = ParameterGroupArgs(
        description = description,
        family = family,
        name = name,
        namePrefix = namePrefix,
        parameters = parameters,
        skipDestroy = skipDestroy,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy