ReplicationInstanceArgs

data class ReplicationInstanceArgs(val allocatedStorage: Output<Int>? = null, val allowMajorVersionUpgrade: Output<Boolean>? = null, val applyImmediately: Output<Boolean>? = null, val autoMinorVersionUpgrade: Output<Boolean>? = null, val availabilityZone: Output<String>? = null, val engineVersion: Output<String>? = null, val kmsKeyArn: Output<String>? = null, val multiAz: Output<Boolean>? = null, val preferredMaintenanceWindow: Output<String>? = null, val publiclyAccessible: Output<Boolean>? = null, val replicationInstanceClass: Output<String>? = null, val replicationInstanceId: Output<String>? = null, val replicationSubnetGroupId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val vpcSecurityGroupIds: Output<List<String>>? = null) : ConvertibleToJava<ReplicationInstanceArgs>

Provides a DMS (Data Migration Service) replication instance resource. DMS replication instances can be created, updated, deleted, and imported.

Example Usage

Create required roles and then create a DMS instance, setting the depends_on to the required role policy attachments.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import com.pulumi.aws.dms.ReplicationInstance;
import com.pulumi.aws.dms.ReplicationInstanceArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
final var dmsAssumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions("sts:AssumeRole")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.identifiers("dms.amazonaws.com")
.type("Service")
.build())
.build())
.build());
var dms_access_for_endpoint = new Role("dms-access-for-endpoint", RoleArgs.builder()
.assumeRolePolicy(dmsAssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var dms_access_for_endpoint_AmazonDMSRedshiftS3Role = new RolePolicyAttachment("dms-access-for-endpoint-AmazonDMSRedshiftS3Role", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/service-role/AmazonDMSRedshiftS3Role")
.role(dms_access_for_endpoint.name())
.build());
var dms_cloudwatch_logs_role = new Role("dms-cloudwatch-logs-role", RoleArgs.builder()
.assumeRolePolicy(dmsAssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var dms_cloudwatch_logs_role_AmazonDMSCloudWatchLogsRole = new RolePolicyAttachment("dms-cloudwatch-logs-role-AmazonDMSCloudWatchLogsRole", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/service-role/AmazonDMSCloudWatchLogsRole")
.role(dms_cloudwatch_logs_role.name())
.build());
var dms_vpc_role = new Role("dms-vpc-role", RoleArgs.builder()
.assumeRolePolicy(dmsAssumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var dms_vpc_role_AmazonDMSVPCManagementRole = new RolePolicyAttachment("dms-vpc-role-AmazonDMSVPCManagementRole", RolePolicyAttachmentArgs.builder()
.policyArn("arn:aws:iam::aws:policy/service-role/AmazonDMSVPCManagementRole")
.role(dms_vpc_role.name())
.build());
var test = new ReplicationInstance("test", ReplicationInstanceArgs.builder()
.allocatedStorage(20)
.applyImmediately(true)
.autoMinorVersionUpgrade(true)
.availabilityZone("us-west-2c")
.engineVersion("3.1.4")
.kmsKeyArn("arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012")
.multiAz(false)
.preferredMaintenanceWindow("sun:10:30-sun:14:30")
.publiclyAccessible(true)
.replicationInstanceClass("dms.t2.micro")
.replicationInstanceId("test-dms-replication-instance-tf")
.replicationSubnetGroupId(aws_dms_replication_subnet_group.test-dms-replication-subnet-group-tf().id())
.tags(Map.of("Name", "test"))
.vpcSecurityGroupIds("sg-12345678")
.build(), CustomResourceOptions.builder()
.dependsOn(
dms_access_for_endpoint_AmazonDMSRedshiftS3Role,
dms_cloudwatch_logs_role_AmazonDMSCloudWatchLogsRole,
dms_vpc_role_AmazonDMSVPCManagementRole)
.build());
}
}

Import

Replication instances can be imported using the replication_instance_id, e.g.,

$ pulumi import aws:dms/replicationInstance:ReplicationInstance test test-dms-replication-instance-tf

Constructors

Link copied to clipboard
constructor(allocatedStorage: Output<Int>? = null, allowMajorVersionUpgrade: Output<Boolean>? = null, applyImmediately: Output<Boolean>? = null, autoMinorVersionUpgrade: Output<Boolean>? = null, availabilityZone: Output<String>? = null, engineVersion: Output<String>? = null, kmsKeyArn: Output<String>? = null, multiAz: Output<Boolean>? = null, preferredMaintenanceWindow: Output<String>? = null, publiclyAccessible: Output<Boolean>? = null, replicationInstanceClass: Output<String>? = null, replicationInstanceId: Output<String>? = null, replicationSubnetGroupId: Output<String>? = null, tags: Output<Map<String, String>>? = null, vpcSecurityGroupIds: Output<List<String>>? = null)

Properties

Link copied to clipboard
val allocatedStorage: Output<Int>? = null

The amount of storage (in gigabytes) to be initially allocated for the replication instance.

Link copied to clipboard
val allowMajorVersionUpgrade: Output<Boolean>? = null

Indicates that major version upgrades are allowed.

Link copied to clipboard
val applyImmediately: Output<Boolean>? = null

Indicates whether the changes should be applied immediately or during the next maintenance window. Only used when updating an existing resource.

Link copied to clipboard
val autoMinorVersionUpgrade: Output<Boolean>? = null

Indicates that minor engine upgrades will be applied automatically to the replication instance during the maintenance window.

Link copied to clipboard
val availabilityZone: Output<String>? = null

The EC2 Availability Zone that the replication instance will be created in.

Link copied to clipboard
val engineVersion: Output<String>? = null

The engine version number of the replication instance.

Link copied to clipboard
val kmsKeyArn: Output<String>? = null

The Amazon Resource Name (ARN) for the KMS key that will be used to encrypt the connection parameters. If you do not specify a value for kms_key_arn, then AWS DMS will use your default encryption key. AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default encryption key for each AWS region.

Link copied to clipboard
val multiAz: Output<Boolean>? = null

Specifies if the replication instance is a multi-az deployment. You cannot set the availability_zone parameter if the multi_az parameter is set to true.

Link copied to clipboard
val preferredMaintenanceWindow: Output<String>? = null

The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

Link copied to clipboard
val publiclyAccessible: Output<Boolean>? = null

Specifies the accessibility options for the replication instance. A value of true represents an instance with a public IP address. A value of false represents an instance with a private IP address.

Link copied to clipboard
val replicationInstanceClass: Output<String>? = null

The compute and memory capacity of the replication instance as specified by the replication instance class. See AWS DMS User Guide for available instance sizes and advice on which one to choose.

Link copied to clipboard
val replicationInstanceId: Output<String>? = null

The replication instance identifier. This parameter is stored as a lowercase string.

Link copied to clipboard
val replicationSubnetGroupId: Output<String>? = null

A subnet group to associate with the replication instance.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

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.

Link copied to clipboard
val vpcSecurityGroupIds: Output<List<String>>? = null

A list of VPC security group IDs to be used with the replication instance. The VPC security groups must work with the VPC containing the replication instance.

Functions

Link copied to clipboard
open override fun toJava(): ReplicationInstanceArgs