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年前598ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ