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

com.pulumi.aws.rds.kotlin.ClusterInstanceArgs.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.66.3.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.rds.kotlin

import com.pulumi.aws.rds.ClusterInstanceArgs.builder
import com.pulumi.aws.rds.kotlin.enums.InstanceType
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides an RDS Cluster Instance Resource. A Cluster Instance Resource defines
 * attributes that are specific to a single instance in a RDS Cluster,
 * specifically running Amazon Aurora.
 * Unlike other RDS resources that support replication, with Amazon Aurora you do
 * not designate a primary and subsequent replicas. Instead, you simply add RDS
 * Instances and Aurora manages the replication. You can use the [count][5]
 * meta-parameter to make multiple instances and join them all to the same RDS
 * Cluster, or you may specify different Cluster Instance resources with various
 * `instance_class` sizes.
 * For more information on Amazon Aurora, see [Aurora on Amazon RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html) in the Amazon RDS User Guide.
 * > **NOTE:** Deletion Protection from the RDS service can only be enabled at the cluster level, not for individual cluster instances. You can still add the [`protect` CustomResourceOption](https://www.pulumi.com/docs/intro/concepts/programming-model/#protect) to this resource configuration if you desire protection from accidental deletion.
 * > **NOTE:** `aurora` is no longer a valid `engine` because of [Amazon Aurora's MySQL-Compatible Edition version 1 end of life](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.MySQL56.EOL.html).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const _default = new aws.rds.Cluster("default", {
 *     clusterIdentifier: "aurora-cluster-demo",
 *     availabilityZones: [
 *         "us-west-2a",
 *         "us-west-2b",
 *         "us-west-2c",
 *     ],
 *     databaseName: "mydb",
 *     masterUsername: "foo",
 *     masterPassword: "barbut8chars",
 * });
 * const clusterInstances: aws.rds.ClusterInstance[] = [];
 * for (const range = {value: 0}; range.value < 2; range.value++) {
 *     clusterInstances.push(new aws.rds.ClusterInstance(`cluster_instances-${range.value}`, {
 *         identifier: `aurora-cluster-demo-${range.value}`,
 *         clusterIdentifier: _default.id,
 *         instanceClass: aws.rds.InstanceType.R4_Large,
 *         engine: _default.engine,
 *         engineVersion: _default.engineVersion,
 *     }));
 * }
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * default = aws.rds.Cluster("default",
 *     cluster_identifier="aurora-cluster-demo",
 *     availability_zones=[
 *         "us-west-2a",
 *         "us-west-2b",
 *         "us-west-2c",
 *     ],
 *     database_name="mydb",
 *     master_username="foo",
 *     master_password="barbut8chars")
 * cluster_instances = []
 * for range in [{"value": i} for i in range(0, 2)]:
 *     cluster_instances.append(aws.rds.ClusterInstance(f"cluster_instances-{range['value']}",
 *         identifier=f"aurora-cluster-demo-{range['value']}",
 *         cluster_identifier=default.id,
 *         instance_class=aws.rds.InstanceType.R4_LARGE,
 *         engine=default.engine,
 *         engine_version=default.engine_version))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Aws.Rds.Cluster("default", new()
 *     {
 *         ClusterIdentifier = "aurora-cluster-demo",
 *         AvailabilityZones = new[]
 *         {
 *             "us-west-2a",
 *             "us-west-2b",
 *             "us-west-2c",
 *         },
 *         DatabaseName = "mydb",
 *         MasterUsername = "foo",
 *         MasterPassword = "barbut8chars",
 *     });
 *     var clusterInstances = new List();
 *     for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
 *     {
 *         var range = new { Value = rangeIndex };
 *         clusterInstances.Add(new Aws.Rds.ClusterInstance($"cluster_instances-{range.Value}", new()
 *         {
 *             Identifier = $"aurora-cluster-demo-{range.Value}",
 *             ClusterIdentifier = @default.Id,
 *             InstanceClass = Aws.Rds.InstanceType.R4_Large,
 *             Engine = @default.Engine,
 *             EngineVersion = @default.EngineVersion,
 *         }));
 *     }
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"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.NewCluster(ctx, "default", &rds.ClusterArgs{
 * 			ClusterIdentifier: pulumi.String("aurora-cluster-demo"),
 * 			AvailabilityZones: pulumi.StringArray{
 * 				pulumi.String("us-west-2a"),
 * 				pulumi.String("us-west-2b"),
 * 				pulumi.String("us-west-2c"),
 * 			},
 * 			DatabaseName:   pulumi.String("mydb"),
 * 			MasterUsername: pulumi.String("foo"),
 * 			MasterPassword: pulumi.String("barbut8chars"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		var clusterInstances []*rds.ClusterInstance
 * 		for index := 0; index < 2; index++ {
 * 			key0 := index
 * 			val0 := index
 * 			__res, err := rds.NewClusterInstance(ctx, fmt.Sprintf("cluster_instances-%v", key0), &rds.ClusterInstanceArgs{
 * 				Identifier:        pulumi.Sprintf("aurora-cluster-demo-%v", val0),
 * 				ClusterIdentifier: _default.ID(),
 * 				InstanceClass:     pulumi.String(rds.InstanceType_R4_Large),
 * 				Engine:            _default.Engine,
 * 				EngineVersion:     _default.EngineVersion,
 * 			})
 * 			if err != nil {
 * 				return err
 * 			}
 * 			clusterInstances = append(clusterInstances, __res)
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.rds.Cluster;
 * import com.pulumi.aws.rds.ClusterArgs;
 * import com.pulumi.aws.rds.ClusterInstance;
 * import com.pulumi.aws.rds.ClusterInstanceArgs;
 * import com.pulumi.codegen.internal.KeyedValue;
 * 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 Cluster("default", ClusterArgs.builder()
 *             .clusterIdentifier("aurora-cluster-demo")
 *             .availabilityZones(
 *                 "us-west-2a",
 *                 "us-west-2b",
 *                 "us-west-2c")
 *             .databaseName("mydb")
 *             .masterUsername("foo")
 *             .masterPassword("barbut8chars")
 *             .build());
 *         for (var i = 0; i < 2; i++) {
 *             new ClusterInstance("clusterInstances-" + i, ClusterInstanceArgs.builder()
 *                 .identifier(String.format("aurora-cluster-demo-%s", range.value()))
 *                 .clusterIdentifier(default_.id())
 *                 .instanceClass("db.r4.large")
 *                 .engine(default_.engine())
 *                 .engineVersion(default_.engineVersion())
 *                 .build());
 * }
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   clusterInstances:
 *     type: aws:rds:ClusterInstance
 *     name: cluster_instances
 *     properties:
 *       identifier: aurora-cluster-demo-${range.value}
 *       clusterIdentifier: ${default.id}
 *       instanceClass: db.r4.large
 *       engine: ${default.engine}
 *       engineVersion: ${default.engineVersion}
 *     options: {}
 *   default:
 *     type: aws:rds:Cluster
 *     properties:
 *       clusterIdentifier: aurora-cluster-demo
 *       availabilityZones:
 *         - us-west-2a
 *         - us-west-2b
 *         - us-west-2c
 *       databaseName: mydb
 *       masterUsername: foo
 *       masterPassword: barbut8chars
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import RDS Cluster Instances using the `identifier`. For example:
 * ```sh
 * $ pulumi import aws:rds/clusterInstance:ClusterInstance prod_instance_1 aurora-cluster-instance-1
 * ```
 * @property applyImmediately Specifies whether any database modifications are applied immediately, or during the next maintenance window. Default is`false`.
 * @property autoMinorVersionUpgrade Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`.
 * @property availabilityZone EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details.
 * @property caCertIdentifier Identifier of the CA certificate for the DB instance.
 * @property clusterIdentifier Identifier of the `aws.rds.Cluster` in which to launch this instance.
 * @property copyTagsToSnapshot Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`.
 * @property customIamInstanceProfile Instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
 * @property dbParameterGroupName Name of the DB parameter group to associate with this instance.
 * @property dbSubnetGroupName Specifies the DB subnet group to associate with this DB instance. The default behavior varies depending on whether `db_subnet_group_name` is specified. Please refer to official [AWS documentation](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) to understand how `db_subnet_group_name` and `publicly_accessible` parameters affect DB instance behaviour. **NOTE:** This must match the `db_subnet_group_name` of the attached `aws.rds.Cluster`.
 * @property engine Name of the database engine to be used for the RDS cluster instance.
 * Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`.(Note that `mysql` and `postgres` are Multi-AZ RDS clusters).
 * @property engineVersion Database engine version. Please note that to upgrade the `engine_version` of the instance, it must be done on the `aws.rds.Cluster` `engine_version`. Trying to upgrade in `aws_cluster_instance` will not update the `engine_version`.
 * @property identifier Identifier for the RDS instance, if omitted, Pulumi will assign a random, unique identifier.
 * @property identifierPrefix Creates a unique identifier beginning with the specified prefix. Conflicts with `identifier`.
 * @property instanceClass Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html). Aurora uses `db.*` instance classes/types. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) for currently available instance classes and complete details. For Aurora Serverless v2 use `db.serverless`.
 * @property monitoringInterval Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60.
 * @property monitoringRoleArn ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances.
 * @property performanceInsightsEnabled Specifies whether Performance Insights is enabled or not.
 * @property performanceInsightsKmsKeyId ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true.
 * @property performanceInsightsRetentionPeriod Amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'.
 * @property preferredBackupWindow Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted.
 * @property preferredMaintenanceWindow Window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00".
 * @property promotionTier Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.
 * @property publiclyAccessible Bool to control if instance is publicly accessible. Default `false`. See the documentation on [Creating DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) for more details on controlling this property.
 * @property tags Map of tags to assign to the instance. 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 ClusterInstanceArgs(
    public val applyImmediately: Output? = null,
    public val autoMinorVersionUpgrade: Output? = null,
    public val availabilityZone: Output? = null,
    public val caCertIdentifier: Output? = null,
    public val clusterIdentifier: Output? = null,
    public val copyTagsToSnapshot: Output? = null,
    public val customIamInstanceProfile: Output? = null,
    public val dbParameterGroupName: Output? = null,
    public val dbSubnetGroupName: Output? = null,
    public val engine: Output? = null,
    public val engineVersion: Output? = null,
    public val identifier: Output? = null,
    public val identifierPrefix: Output? = null,
    public val instanceClass: Output>? = null,
    public val monitoringInterval: Output? = null,
    public val monitoringRoleArn: Output? = null,
    public val performanceInsightsEnabled: Output? = null,
    public val performanceInsightsKmsKeyId: Output? = null,
    public val performanceInsightsRetentionPeriod: Output? = null,
    public val preferredBackupWindow: Output? = null,
    public val preferredMaintenanceWindow: Output? = null,
    public val promotionTier: Output? = null,
    public val publiclyAccessible: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.rds.ClusterInstanceArgs =
        com.pulumi.aws.rds.ClusterInstanceArgs.builder()
            .applyImmediately(applyImmediately?.applyValue({ args0 -> args0 }))
            .autoMinorVersionUpgrade(autoMinorVersionUpgrade?.applyValue({ args0 -> args0 }))
            .availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
            .caCertIdentifier(caCertIdentifier?.applyValue({ args0 -> args0 }))
            .clusterIdentifier(clusterIdentifier?.applyValue({ args0 -> args0 }))
            .copyTagsToSnapshot(copyTagsToSnapshot?.applyValue({ args0 -> args0 }))
            .customIamInstanceProfile(customIamInstanceProfile?.applyValue({ args0 -> args0 }))
            .dbParameterGroupName(dbParameterGroupName?.applyValue({ args0 -> args0 }))
            .dbSubnetGroupName(dbSubnetGroupName?.applyValue({ args0 -> args0 }))
            .engine(engine?.applyValue({ args0 -> args0 }))
            .engineVersion(engineVersion?.applyValue({ args0 -> args0 }))
            .identifier(identifier?.applyValue({ args0 -> args0 }))
            .identifierPrefix(identifierPrefix?.applyValue({ args0 -> args0 }))
            .instanceClass(
                instanceClass?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .monitoringInterval(monitoringInterval?.applyValue({ args0 -> args0 }))
            .monitoringRoleArn(monitoringRoleArn?.applyValue({ args0 -> args0 }))
            .performanceInsightsEnabled(performanceInsightsEnabled?.applyValue({ args0 -> args0 }))
            .performanceInsightsKmsKeyId(performanceInsightsKmsKeyId?.applyValue({ args0 -> args0 }))
            .performanceInsightsRetentionPeriod(
                performanceInsightsRetentionPeriod?.applyValue({ args0 ->
                    args0
                }),
            )
            .preferredBackupWindow(preferredBackupWindow?.applyValue({ args0 -> args0 }))
            .preferredMaintenanceWindow(preferredMaintenanceWindow?.applyValue({ args0 -> args0 }))
            .promotionTier(promotionTier?.applyValue({ args0 -> args0 }))
            .publiclyAccessible(publiclyAccessible?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ClusterInstanceArgs].
 */
@PulumiTagMarker
public class ClusterInstanceArgsBuilder internal constructor() {
    private var applyImmediately: Output? = null

    private var autoMinorVersionUpgrade: Output? = null

    private var availabilityZone: Output? = null

    private var caCertIdentifier: Output? = null

    private var clusterIdentifier: Output? = null

    private var copyTagsToSnapshot: Output? = null

    private var customIamInstanceProfile: Output? = null

    private var dbParameterGroupName: Output? = null

    private var dbSubnetGroupName: Output? = null

    private var engine: Output? = null

    private var engineVersion: Output? = null

    private var identifier: Output? = null

    private var identifierPrefix: Output? = null

    private var instanceClass: Output>? = null

    private var monitoringInterval: Output? = null

    private var monitoringRoleArn: Output? = null

    private var performanceInsightsEnabled: Output? = null

    private var performanceInsightsKmsKeyId: Output? = null

    private var performanceInsightsRetentionPeriod: Output? = null

    private var preferredBackupWindow: Output? = null

    private var preferredMaintenanceWindow: Output? = null

    private var promotionTier: Output? = null

    private var publiclyAccessible: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies whether any database modifications are applied immediately, or during the next maintenance window. Default is`false`.
     */
    @JvmName("kwjncfswlntkijyc")
    public suspend fun applyImmediately(`value`: Output) {
        this.applyImmediately = value
    }

    /**
     * @param value Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`.
     */
    @JvmName("wfudcxcniccamtqh")
    public suspend fun autoMinorVersionUpgrade(`value`: Output) {
        this.autoMinorVersionUpgrade = value
    }

    /**
     * @param value EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details.
     */
    @JvmName("flsekilfnnqcsohi")
    public suspend fun availabilityZone(`value`: Output) {
        this.availabilityZone = value
    }

    /**
     * @param value Identifier of the CA certificate for the DB instance.
     */
    @JvmName("hrxknbidvtvjqror")
    public suspend fun caCertIdentifier(`value`: Output) {
        this.caCertIdentifier = value
    }

    /**
     * @param value Identifier of the `aws.rds.Cluster` in which to launch this instance.
     */
    @JvmName("mglctfujofblcuva")
    public suspend fun clusterIdentifier(`value`: Output) {
        this.clusterIdentifier = value
    }

    /**
     * @param value Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`.
     */
    @JvmName("npkviffkkyqxsmmh")
    public suspend fun copyTagsToSnapshot(`value`: Output) {
        this.copyTagsToSnapshot = value
    }

    /**
     * @param value Instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
     */
    @JvmName("nexydrhkqqhhhknu")
    public suspend fun customIamInstanceProfile(`value`: Output) {
        this.customIamInstanceProfile = value
    }

    /**
     * @param value Name of the DB parameter group to associate with this instance.
     */
    @JvmName("iahtvllhsrpegwme")
    public suspend fun dbParameterGroupName(`value`: Output) {
        this.dbParameterGroupName = value
    }

    /**
     * @param value Specifies the DB subnet group to associate with this DB instance. The default behavior varies depending on whether `db_subnet_group_name` is specified. Please refer to official [AWS documentation](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) to understand how `db_subnet_group_name` and `publicly_accessible` parameters affect DB instance behaviour. **NOTE:** This must match the `db_subnet_group_name` of the attached `aws.rds.Cluster`.
     */
    @JvmName("xeohgxbtkyxwtdoq")
    public suspend fun dbSubnetGroupName(`value`: Output) {
        this.dbSubnetGroupName = value
    }

    /**
     * @param value Name of the database engine to be used for the RDS cluster instance.
     * Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`.(Note that `mysql` and `postgres` are Multi-AZ RDS clusters).
     */
    @JvmName("vdgyofdorbtytvpy")
    public suspend fun engine(`value`: Output) {
        this.engine = value
    }

    /**
     * @param value Database engine version. Please note that to upgrade the `engine_version` of the instance, it must be done on the `aws.rds.Cluster` `engine_version`. Trying to upgrade in `aws_cluster_instance` will not update the `engine_version`.
     */
    @JvmName("fypjycliaieifygx")
    public suspend fun engineVersion(`value`: Output) {
        this.engineVersion = value
    }

    /**
     * @param value Identifier for the RDS instance, if omitted, Pulumi will assign a random, unique identifier.
     */
    @JvmName("ldtljitresnjmlrh")
    public suspend fun identifier(`value`: Output) {
        this.identifier = value
    }

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

    /**
     * @param value Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html). Aurora uses `db.*` instance classes/types. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) for currently available instance classes and complete details. For Aurora Serverless v2 use `db.serverless`.
     */
    @JvmName("grcvnsamwadaidhq")
    public suspend fun instanceClass(`value`: Output>) {
        this.instanceClass = value
    }

    /**
     * @param value Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60.
     */
    @JvmName("hwdhcgtemyhnfobu")
    public suspend fun monitoringInterval(`value`: Output) {
        this.monitoringInterval = value
    }

    /**
     * @param value ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances.
     */
    @JvmName("gxkojdmxstcolniw")
    public suspend fun monitoringRoleArn(`value`: Output) {
        this.monitoringRoleArn = value
    }

    /**
     * @param value Specifies whether Performance Insights is enabled or not.
     */
    @JvmName("poeoabidiewmfpum")
    public suspend fun performanceInsightsEnabled(`value`: Output) {
        this.performanceInsightsEnabled = value
    }

    /**
     * @param value ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true.
     */
    @JvmName("axfledvjmkrxdpju")
    public suspend fun performanceInsightsKmsKeyId(`value`: Output) {
        this.performanceInsightsKmsKeyId = value
    }

    /**
     * @param value Amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'.
     */
    @JvmName("ylvkbskilewxctoy")
    public suspend fun performanceInsightsRetentionPeriod(`value`: Output) {
        this.performanceInsightsRetentionPeriod = value
    }

    /**
     * @param value Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted.
     */
    @JvmName("srbpjnnkkguesmlf")
    public suspend fun preferredBackupWindow(`value`: Output) {
        this.preferredBackupWindow = value
    }

    /**
     * @param value Window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00".
     */
    @JvmName("huitlxysjmlcltob")
    public suspend fun preferredMaintenanceWindow(`value`: Output) {
        this.preferredMaintenanceWindow = value
    }

    /**
     * @param value Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.
     */
    @JvmName("hsbtlgfjvskysvuk")
    public suspend fun promotionTier(`value`: Output) {
        this.promotionTier = value
    }

    /**
     * @param value Bool to control if instance is publicly accessible. Default `false`. See the documentation on [Creating DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) for more details on controlling this property.
     */
    @JvmName("rcevpgjhxkqfntti")
    public suspend fun publiclyAccessible(`value`: Output) {
        this.publiclyAccessible = value
    }

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

    /**
     * @param value Specifies whether any database modifications are applied immediately, or during the next maintenance window. Default is`false`.
     */
    @JvmName("vyepbdvmyyxsgayi")
    public suspend fun applyImmediately(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applyImmediately = mapped
    }

    /**
     * @param value Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`.
     */
    @JvmName("wgfwhlhrxbooqvst")
    public suspend fun autoMinorVersionUpgrade(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoMinorVersionUpgrade = mapped
    }

    /**
     * @param value EC2 Availability Zone that the DB instance is created in. See [docs](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) about the details.
     */
    @JvmName("yxdgvwrmobvslkjy")
    public suspend fun availabilityZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availabilityZone = mapped
    }

    /**
     * @param value Identifier of the CA certificate for the DB instance.
     */
    @JvmName("moujkvdeetjgcgox")
    public suspend fun caCertIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.caCertIdentifier = mapped
    }

    /**
     * @param value Identifier of the `aws.rds.Cluster` in which to launch this instance.
     */
    @JvmName("ixtqklyuxxqpgyja")
    public suspend fun clusterIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterIdentifier = mapped
    }

    /**
     * @param value Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. Default `false`.
     */
    @JvmName("qmlpciqlwbyuwknu")
    public suspend fun copyTagsToSnapshot(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.copyTagsToSnapshot = mapped
    }

    /**
     * @param value Instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
     */
    @JvmName("gnaltwsfvvrjoiyn")
    public suspend fun customIamInstanceProfile(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customIamInstanceProfile = mapped
    }

    /**
     * @param value Name of the DB parameter group to associate with this instance.
     */
    @JvmName("rdmdekjjsvqblqhc")
    public suspend fun dbParameterGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dbParameterGroupName = mapped
    }

    /**
     * @param value Specifies the DB subnet group to associate with this DB instance. The default behavior varies depending on whether `db_subnet_group_name` is specified. Please refer to official [AWS documentation](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html) to understand how `db_subnet_group_name` and `publicly_accessible` parameters affect DB instance behaviour. **NOTE:** This must match the `db_subnet_group_name` of the attached `aws.rds.Cluster`.
     */
    @JvmName("nxbkrvgplsprghfk")
    public suspend fun dbSubnetGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dbSubnetGroupName = mapped
    }

    /**
     * @param value Name of the database engine to be used for the RDS cluster instance.
     * Valid Values: `aurora-mysql`, `aurora-postgresql`, `mysql`, `postgres`.(Note that `mysql` and `postgres` are Multi-AZ RDS clusters).
     */
    @JvmName("xnifinhhboutbogo")
    public suspend fun engine(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.engine = mapped
    }

    /**
     * @param value Database engine version. Please note that to upgrade the `engine_version` of the instance, it must be done on the `aws.rds.Cluster` `engine_version`. Trying to upgrade in `aws_cluster_instance` will not update the `engine_version`.
     */
    @JvmName("toffdcjxurmltlmd")
    public suspend fun engineVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.engineVersion = mapped
    }

    /**
     * @param value Identifier for the RDS instance, if omitted, Pulumi will assign a random, unique identifier.
     */
    @JvmName("uncitlooeejvkbna")
    public suspend fun identifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identifier = mapped
    }

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

    /**
     * @param value Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html). Aurora uses `db.*` instance classes/types. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) for currently available instance classes and complete details. For Aurora Serverless v2 use `db.serverless`.
     */
    @JvmName("trlfvvraukisknjs")
    public suspend fun instanceClass(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceClass = mapped
    }

    /**
     * @param value Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html). Aurora uses `db.*` instance classes/types. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) for currently available instance classes and complete details. For Aurora Serverless v2 use `db.serverless`.
     */
    @JvmName("fnyxbphfagomxkor")
    public fun instanceClass(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.instanceClass = mapped
    }

    /**
     * @param value Instance class to use. For details on CPU and memory, see [Scaling Aurora DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html). Aurora uses `db.*` instance classes/types. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) for currently available instance classes and complete details. For Aurora Serverless v2 use `db.serverless`.
     */
    @JvmName("wrfbuyrimvaalhmg")
    public fun instanceClass(`value`: InstanceType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.instanceClass = mapped
    }

    /**
     * @param value Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60.
     */
    @JvmName("yebxxfehxvcioygj")
    public suspend fun monitoringInterval(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.monitoringInterval = mapped
    }

    /**
     * @param value ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances.
     */
    @JvmName("mbmmkbodmplvvrlw")
    public suspend fun monitoringRoleArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.monitoringRoleArn = mapped
    }

    /**
     * @param value Specifies whether Performance Insights is enabled or not.
     */
    @JvmName("sgtxcekxakaxyfvf")
    public suspend fun performanceInsightsEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.performanceInsightsEnabled = mapped
    }

    /**
     * @param value ARN for the KMS key to encrypt Performance Insights data. When specifying `performance_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true.
     */
    @JvmName("spyixbqkrmcmfmgv")
    public suspend fun performanceInsightsKmsKeyId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.performanceInsightsKmsKeyId = mapped
    }

    /**
     * @param value Amount of time in days to retain Performance Insights data. Valid values are `7`, `731` (2 years) or a multiple of `31`. When specifying `performance_insights_retention_period`, `performance_insights_enabled` needs to be set to true. Defaults to '7'.
     */
    @JvmName("wqoqymgcebmqqcmc")
    public suspend fun performanceInsightsRetentionPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.performanceInsightsRetentionPeriod = mapped
    }

    /**
     * @param value Daily time range during which automated backups are created if automated backups are enabled. Eg: "04:00-09:00". **NOTE:** If `preferred_backup_window` is set at the cluster level, this argument **must** be omitted.
     */
    @JvmName("uotnudgstnfuspho")
    public suspend fun preferredBackupWindow(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preferredBackupWindow = mapped
    }

    /**
     * @param value Window to perform maintenance in. Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00".
     */
    @JvmName("wllfapxhfrenujnf")
    public suspend fun preferredMaintenanceWindow(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preferredMaintenanceWindow = mapped
    }

    /**
     * @param value Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.
     */
    @JvmName("ycevhlkyoytrhwlb")
    public suspend fun promotionTier(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.promotionTier = mapped
    }

    /**
     * @param value Bool to control if instance is publicly accessible. Default `false`. See the documentation on [Creating DB Instances](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) for more details on controlling this property.
     */
    @JvmName("vmgngdpixdepmyrf")
    public suspend fun publiclyAccessible(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publiclyAccessible = mapped
    }

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

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

    internal fun build(): ClusterInstanceArgs = ClusterInstanceArgs(
        applyImmediately = applyImmediately,
        autoMinorVersionUpgrade = autoMinorVersionUpgrade,
        availabilityZone = availabilityZone,
        caCertIdentifier = caCertIdentifier,
        clusterIdentifier = clusterIdentifier,
        copyTagsToSnapshot = copyTagsToSnapshot,
        customIamInstanceProfile = customIamInstanceProfile,
        dbParameterGroupName = dbParameterGroupName,
        dbSubnetGroupName = dbSubnetGroupName,
        engine = engine,
        engineVersion = engineVersion,
        identifier = identifier,
        identifierPrefix = identifierPrefix,
        instanceClass = instanceClass,
        monitoringInterval = monitoringInterval,
        monitoringRoleArn = monitoringRoleArn,
        performanceInsightsEnabled = performanceInsightsEnabled,
        performanceInsightsKmsKeyId = performanceInsightsKmsKeyId,
        performanceInsightsRetentionPeriod = performanceInsightsRetentionPeriod,
        preferredBackupWindow = preferredBackupWindow,
        preferredMaintenanceWindow = preferredMaintenanceWindow,
        promotionTier = promotionTier,
        publiclyAccessible = publiclyAccessible,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy