Replication Instance Args
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
Properties
The amount of storage (in gigabytes) to be initially allocated for the replication instance.
Indicates that major version upgrades are allowed.
Indicates whether the changes should be applied immediately or during the next maintenance window. Only used when updating an existing resource.
Indicates that minor engine upgrades will be applied automatically to the replication instance during the maintenance window.
The EC2 Availability Zone that the replication instance will be created in.
The engine version number of the replication instance.
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.
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
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.
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.
The replication instance identifier. This parameter is stored as a lowercase string.
A subnet group to associate with the replication instance.
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.