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

gefragt vor 4 Jahren629 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen