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

posta 4 anni fa629 visualizzazioni
1 Risposta
0
Risposta accettata

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.

con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande