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

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

package com.pulumi.aws.dms.kotlin

import com.pulumi.aws.dms.ReplicationConfigArgs.builder
import com.pulumi.aws.dms.kotlin.inputs.ReplicationConfigComputeConfigArgs
import com.pulumi.aws.dms.kotlin.inputs.ReplicationConfigComputeConfigArgsBuilder
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.Map
import kotlin.jvm.JvmName

/**
 * Provides a DMS Serverless replication config resource.
 * > **NOTE:** Changing most arguments will stop the replication if it is running. You can set `start_replication` to resume the replication afterwards.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const name = new aws.dms.ReplicationConfig("name", {
 *     replicationConfigIdentifier: "test-dms-serverless-replication-tf",
 *     resourceIdentifier: "test-dms-serverless-replication-tf",
 *     replicationType: "cdc",
 *     sourceEndpointArn: source.endpointArn,
 *     targetEndpointArn: target.endpointArn,
 *     tableMappings: `  {
 *     "rules":[{"rule-type":"selection","rule-id":"1","rule-name":"1","rule-action":"include","object-locator":{"schema-name":"%%","table-name":"%%"}}]
 *   }
 * `,
 *     startReplication: true,
 *     computeConfig: {
 *         replicationSubnetGroupId: _default.replicationSubnetGroupId,
 *         maxCapacityUnits: 64,
 *         minCapacityUnits: 2,
 *         preferredMaintenanceWindow: "sun:23:45-mon:00:30",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * name = aws.dms.ReplicationConfig("name",
 *     replication_config_identifier="test-dms-serverless-replication-tf",
 *     resource_identifier="test-dms-serverless-replication-tf",
 *     replication_type="cdc",
 *     source_endpoint_arn=source["endpointArn"],
 *     target_endpoint_arn=target["endpointArn"],
 *     table_mappings="""  {
 *     "rules":[{"rule-type":"selection","rule-id":"1","rule-name":"1","rule-action":"include","object-locator":{"schema-name":"%%","table-name":"%%"}}]
 *   }
 * """,
 *     start_replication=True,
 *     compute_config={
 *         "replication_subnet_group_id": default["replicationSubnetGroupId"],
 *         "max_capacity_units": 64,
 *         "min_capacity_units": 2,
 *         "preferred_maintenance_window": "sun:23:45-mon:00:30",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var name = new Aws.Dms.ReplicationConfig("name", new()
 *     {
 *         ReplicationConfigIdentifier = "test-dms-serverless-replication-tf",
 *         ResourceIdentifier = "test-dms-serverless-replication-tf",
 *         ReplicationType = "cdc",
 *         SourceEndpointArn = source.EndpointArn,
 *         TargetEndpointArn = target.EndpointArn,
 *         TableMappings = @"  {
 *     ""rules"":[{""rule-type"":""selection"",""rule-id"":""1"",""rule-name"":""1"",""rule-action"":""include"",""object-locator"":{""schema-name"":""%%"",""table-name"":""%%""}}]
 *   }
 * ",
 *         StartReplication = true,
 *         ComputeConfig = new Aws.Dms.Inputs.ReplicationConfigComputeConfigArgs
 *         {
 *             ReplicationSubnetGroupId = @default.ReplicationSubnetGroupId,
 *             MaxCapacityUnits = 64,
 *             MinCapacityUnits = 2,
 *             PreferredMaintenanceWindow = "sun:23:45-mon:00:30",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dms"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dms.NewReplicationConfig(ctx, "name", &dms.ReplicationConfigArgs{
 * 			ReplicationConfigIdentifier: pulumi.String("test-dms-serverless-replication-tf"),
 * 			ResourceIdentifier:          pulumi.String("test-dms-serverless-replication-tf"),
 * 			ReplicationType:             pulumi.String("cdc"),
 * 			SourceEndpointArn:           pulumi.Any(source.EndpointArn),
 * 			TargetEndpointArn:           pulumi.Any(target.EndpointArn),
 * 			TableMappings:               pulumi.String("  {\n    \"rules\":[{\"rule-type\":\"selection\",\"rule-id\":\"1\",\"rule-name\":\"1\",\"rule-action\":\"include\",\"object-locator\":{\"schema-name\":\"%%\",\"table-name\":\"%%\"}}]\n  }\n"),
 * 			StartReplication:            pulumi.Bool(true),
 * 			ComputeConfig: &dms.ReplicationConfigComputeConfigArgs{
 * 				ReplicationSubnetGroupId:   pulumi.Any(_default.ReplicationSubnetGroupId),
 * 				MaxCapacityUnits:           pulumi.Int(64),
 * 				MinCapacityUnits:           pulumi.Int(2),
 * 				PreferredMaintenanceWindow: pulumi.String("sun:23:45-mon:00:30"),
 * 			},
 * 		})
 * 		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.dms.ReplicationConfig;
 * import com.pulumi.aws.dms.ReplicationConfigArgs;
 * import com.pulumi.aws.dms.inputs.ReplicationConfigComputeConfigArgs;
 * 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 name = new ReplicationConfig("name", ReplicationConfigArgs.builder()
 *             .replicationConfigIdentifier("test-dms-serverless-replication-tf")
 *             .resourceIdentifier("test-dms-serverless-replication-tf")
 *             .replicationType("cdc")
 *             .sourceEndpointArn(source.endpointArn())
 *             .targetEndpointArn(target.endpointArn())
 *             .tableMappings("""
 *   {
 *     "rules":[{"rule-type":"selection","rule-id":"1","rule-name":"1","rule-action":"include","object-locator":{"schema-name":"%%","table-name":"%%"}}]
 *   }
 *             """)
 *             .startReplication(true)
 *             .computeConfig(ReplicationConfigComputeConfigArgs.builder()
 *                 .replicationSubnetGroupId(default_.replicationSubnetGroupId())
 *                 .maxCapacityUnits("64")
 *                 .minCapacityUnits("2")
 *                 .preferredMaintenanceWindow("sun:23:45-mon:00:30")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   name:
 *     type: aws:dms:ReplicationConfig
 *     properties:
 *       replicationConfigIdentifier: test-dms-serverless-replication-tf
 *       resourceIdentifier: test-dms-serverless-replication-tf
 *       replicationType: cdc
 *       sourceEndpointArn: ${source.endpointArn}
 *       targetEndpointArn: ${target.endpointArn}
 *       tableMappings: |2
 *           {
 *             "rules":[{"rule-type":"selection","rule-id":"1","rule-name":"1","rule-action":"include","object-locator":{"schema-name":"%%","table-name":"%%"}}]
 *           }
 *       startReplication: true
 *       computeConfig:
 *         replicationSubnetGroupId: ${default.replicationSubnetGroupId}
 *         maxCapacityUnits: '64'
 *         minCapacityUnits: '2'
 *         preferredMaintenanceWindow: sun:23:45-mon:00:30
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import a replication config using the `arn`. For example:
 * ```sh
 * $ pulumi import aws:dms/replicationConfig:ReplicationConfig example arn:aws:dms:us-east-1:123456789012:replication-config:UX6OL6MHMMJKFFOXE3H7LLJCMEKBDUG4ZV7DRSI
 * ```
 * @property computeConfig Configuration block for provisioning an DMS Serverless replication.
 * @property replicationConfigIdentifier Unique identifier that you want to use to create the config.
 * @property replicationSettings An escaped JSON string that are used to provision this replication configuration. For example, [Change processing tuning settings](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.ChangeProcessingTuning.html)
 * @property replicationType The migration type. Can be one of `full-load | cdc | full-load-and-cdc`.
 * @property resourceIdentifier Unique value or name that you set for a given resource that can be used to construct an Amazon Resource Name (ARN) for that resource. For more information, see [Fine-grained access control using resource names and tags](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#CHAP_Security.FineGrainedAccess)
 * @property sourceEndpointArn The Amazon Resource Name (ARN) string that uniquely identifies the source endpoint.
 * @property startReplication Whether to run or stop the serverless replication, default is false.
 * @property supplementalSettings JSON settings for specifying supplemental data. For more information see [Specifying supplemental data for task settings](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html)
 * @property tableMappings An escaped JSON string that contains the table mappings. For information on table mapping see [Using Table Mapping with an AWS Database Migration Service Task to Select and Filter Data](http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html)
 * @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.
 * @property targetEndpointArn The Amazon Resource Name (ARN) string that uniquely identifies the target endpoint.
 */
public data class ReplicationConfigArgs(
    public val computeConfig: Output? = null,
    public val replicationConfigIdentifier: Output? = null,
    public val replicationSettings: Output? = null,
    public val replicationType: Output? = null,
    public val resourceIdentifier: Output? = null,
    public val sourceEndpointArn: Output? = null,
    public val startReplication: Output? = null,
    public val supplementalSettings: Output? = null,
    public val tableMappings: Output? = null,
    public val tags: Output>? = null,
    public val targetEndpointArn: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.dms.ReplicationConfigArgs =
        com.pulumi.aws.dms.ReplicationConfigArgs.builder()
            .computeConfig(computeConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .replicationConfigIdentifier(replicationConfigIdentifier?.applyValue({ args0 -> args0 }))
            .replicationSettings(replicationSettings?.applyValue({ args0 -> args0 }))
            .replicationType(replicationType?.applyValue({ args0 -> args0 }))
            .resourceIdentifier(resourceIdentifier?.applyValue({ args0 -> args0 }))
            .sourceEndpointArn(sourceEndpointArn?.applyValue({ args0 -> args0 }))
            .startReplication(startReplication?.applyValue({ args0 -> args0 }))
            .supplementalSettings(supplementalSettings?.applyValue({ args0 -> args0 }))
            .tableMappings(tableMappings?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .targetEndpointArn(targetEndpointArn?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ReplicationConfigArgs].
 */
@PulumiTagMarker
public class ReplicationConfigArgsBuilder internal constructor() {
    private var computeConfig: Output? = null

    private var replicationConfigIdentifier: Output? = null

    private var replicationSettings: Output? = null

    private var replicationType: Output? = null

    private var resourceIdentifier: Output? = null

    private var sourceEndpointArn: Output? = null

    private var startReplication: Output? = null

    private var supplementalSettings: Output? = null

    private var tableMappings: Output? = null

    private var tags: Output>? = null

    private var targetEndpointArn: Output? = null

    /**
     * @param value Configuration block for provisioning an DMS Serverless replication.
     */
    @JvmName("mruximbnkjygjrkv")
    public suspend fun computeConfig(`value`: Output) {
        this.computeConfig = value
    }

    /**
     * @param value Unique identifier that you want to use to create the config.
     */
    @JvmName("aojrdqtgniscmegk")
    public suspend fun replicationConfigIdentifier(`value`: Output) {
        this.replicationConfigIdentifier = value
    }

    /**
     * @param value An escaped JSON string that are used to provision this replication configuration. For example, [Change processing tuning settings](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.ChangeProcessingTuning.html)
     */
    @JvmName("spggxkrhruasgmvp")
    public suspend fun replicationSettings(`value`: Output) {
        this.replicationSettings = value
    }

    /**
     * @param value The migration type. Can be one of `full-load | cdc | full-load-and-cdc`.
     */
    @JvmName("dfudtytimrlsfggn")
    public suspend fun replicationType(`value`: Output) {
        this.replicationType = value
    }

    /**
     * @param value Unique value or name that you set for a given resource that can be used to construct an Amazon Resource Name (ARN) for that resource. For more information, see [Fine-grained access control using resource names and tags](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#CHAP_Security.FineGrainedAccess)
     */
    @JvmName("gonjwvchpreamjvi")
    public suspend fun resourceIdentifier(`value`: Output) {
        this.resourceIdentifier = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) string that uniquely identifies the source endpoint.
     */
    @JvmName("looyknlphqxpxdae")
    public suspend fun sourceEndpointArn(`value`: Output) {
        this.sourceEndpointArn = value
    }

    /**
     * @param value Whether to run or stop the serverless replication, default is false.
     */
    @JvmName("glvjdhcgwvpguirf")
    public suspend fun startReplication(`value`: Output) {
        this.startReplication = value
    }

    /**
     * @param value JSON settings for specifying supplemental data. For more information see [Specifying supplemental data for task settings](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html)
     */
    @JvmName("rqjyfgueodoslmhl")
    public suspend fun supplementalSettings(`value`: Output) {
        this.supplementalSettings = value
    }

    /**
     * @param value An escaped JSON string that contains the table mappings. For information on table mapping see [Using Table Mapping with an AWS Database Migration Service Task to Select and Filter Data](http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html)
     */
    @JvmName("xsvlhsbgmqxbiyvn")
    public suspend fun tableMappings(`value`: Output) {
        this.tableMappings = 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("becgfpapbgtighxn")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) string that uniquely identifies the target endpoint.
     */
    @JvmName("wlmmkyucoimtccav")
    public suspend fun targetEndpointArn(`value`: Output) {
        this.targetEndpointArn = value
    }

    /**
     * @param value Configuration block for provisioning an DMS Serverless replication.
     */
    @JvmName("vypdjbrgdpcimhyh")
    public suspend fun computeConfig(`value`: ReplicationConfigComputeConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.computeConfig = mapped
    }

    /**
     * @param argument Configuration block for provisioning an DMS Serverless replication.
     */
    @JvmName("qcodmmynccmojfao")
    public suspend fun computeConfig(argument: suspend ReplicationConfigComputeConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ReplicationConfigComputeConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.computeConfig = mapped
    }

    /**
     * @param value Unique identifier that you want to use to create the config.
     */
    @JvmName("kebnkhgdnehcrwbr")
    public suspend fun replicationConfigIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicationConfigIdentifier = mapped
    }

    /**
     * @param value An escaped JSON string that are used to provision this replication configuration. For example, [Change processing tuning settings](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.ChangeProcessingTuning.html)
     */
    @JvmName("seymnjlafljycfeb")
    public suspend fun replicationSettings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicationSettings = mapped
    }

    /**
     * @param value The migration type. Can be one of `full-load | cdc | full-load-and-cdc`.
     */
    @JvmName("kwnlqhlfpnohrwqp")
    public suspend fun replicationType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicationType = mapped
    }

    /**
     * @param value Unique value or name that you set for a given resource that can be used to construct an Amazon Resource Name (ARN) for that resource. For more information, see [Fine-grained access control using resource names and tags](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#CHAP_Security.FineGrainedAccess)
     */
    @JvmName("qfrfjwopnmtlcuxp")
    public suspend fun resourceIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceIdentifier = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) string that uniquely identifies the source endpoint.
     */
    @JvmName("agqwvijhjjsrhjyi")
    public suspend fun sourceEndpointArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceEndpointArn = mapped
    }

    /**
     * @param value Whether to run or stop the serverless replication, default is false.
     */
    @JvmName("wvftloipndnqjkmv")
    public suspend fun startReplication(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startReplication = mapped
    }

    /**
     * @param value JSON settings for specifying supplemental data. For more information see [Specifying supplemental data for task settings](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.TaskData.html)
     */
    @JvmName("iojuwvpsusrdfyqn")
    public suspend fun supplementalSettings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.supplementalSettings = mapped
    }

    /**
     * @param value An escaped JSON string that contains the table mappings. For information on table mapping see [Using Table Mapping with an AWS Database Migration Service Task to Select and Filter Data](http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html)
     */
    @JvmName("ogvxkidxcvrbrbms")
    public suspend fun tableMappings(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tableMappings = 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("gaugalttwdrwkmec")
    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("abjahsrrjsmonpcd")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) string that uniquely identifies the target endpoint.
     */
    @JvmName("ubgpjrbjifjlkpwd")
    public suspend fun targetEndpointArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetEndpointArn = mapped
    }

    internal fun build(): ReplicationConfigArgs = ReplicationConfigArgs(
        computeConfig = computeConfig,
        replicationConfigIdentifier = replicationConfigIdentifier,
        replicationSettings = replicationSettings,
        replicationType = replicationType,
        resourceIdentifier = resourceIdentifier,
        sourceEndpointArn = sourceEndpointArn,
        startReplication = startReplication,
        supplementalSettings = supplementalSettings,
        tableMappings = tableMappings,
        tags = tags,
        targetEndpointArn = targetEndpointArn,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy