ReplicationInstance

class ReplicationInstance : KotlinCustomResource

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

Properties

Link copied to clipboard
val allocatedStorage: Output<Int>

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

Link copied to clipboard

Indicates that major version upgrades are allowed.

Link copied to clipboard

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

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

Link copied to clipboard

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

Link copied to clipboard
val engineVersion: Output<String>

The engine version number of the replication instance.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val kmsKeyArn: Output<String>

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>

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

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

Link copied to clipboard

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The Amazon Resource Name (ARN) of the replication instance.

Link copied to clipboard

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

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

Link copied to clipboard

A list of the private IP addresses of the replication instance.

Link copied to clipboard

A list of the public IP addresses of the replication instance.

Link copied to clipboard

A subnet group to associate with the replication instance.

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

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 tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

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.