CDK DMS replication instance

0

I try to setup a DMS replication instance using CDK, it's working almost as expected except that the instance is deployed in the default VPC.

Is there a way to choose the VPC for this instance using CDK? It's possible to choose the VPC using the AWS console but I didn't manage to do it using CDK.

Thanks

已提問 4 年前檢視次數 624 次
1 個回答
0
已接受的答案

Manage to make it works with this code:

    tmp = []
    for sub in vpc.private_subnets:
        tmp.append(sub.subnet_id)

    rep_sub = dms.CfnReplicationSubnetGroup(self, "rep_sub",
                                           replication_subnet_group_description="desc rep_sub",
                                           subnet_ids=tmp
                                           )

    rep = dms.CfnReplicationInstance(self, "rep-instance",
                                     replication_instance_class="dms.t2.micro",
                                     replication_subnet_group_identifier=rep_sub.ref,
                                     publicly_accessible=False
                                     )

It creates the Subnet group and the association with the replication instance. The replication instance is then placed in the VPC where the subnets belongs.

已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南