diff --git a/README.md b/README.md index ec403bd..58a8353 100644 --- a/README.md +++ b/README.md @@ -407,8 +407,8 @@ new DatabaseReplica(name: string, args: DatabaseReplicaArgs, opts?: pulumi.Custo ```ts type DatabaseReplicaArgs = { replicateSourceDb: pulumi.Input; - dbSubnetGroupName: pulumi.Input; dbSecurityGroupId: pulumi.Input; + dbSubnetGroupName?: pulumi.Input; monitoringRole?: aws.iam.Role; multiAz?: pulumi.Input; applyImmediately?: pulumi.Input; @@ -421,7 +421,15 @@ type DatabaseReplicaArgs = { }>; }; ``` -Database replica requires primary DB instance to exist. +Database replica requires primary DB instance to exist. If the replica is in the same +region as primary instance, we should not set `dbSubnetGroupNameParam`. +The `replicateSourceDb` param is referenced like this: +```javascript + const primaryDb = new studion.Database(...); + const replica = new studion.DatabaseReplica('replica', { + replicateSourceDb: primaryDb.instance.identifier + }); +``` ### Redis diff --git a/src/components/database-replica.ts b/src/components/database-replica.ts index 9f72659..3233ff0 100644 --- a/src/components/database-replica.ts +++ b/src/components/database-replica.ts @@ -12,7 +12,7 @@ export type DatabaseReplicaArgs = { * * If primary DB is instance of studion:Database, it can be accessed as * `db.dbSubnetGroup.name`. */ - dbSubnetGroupName: pulumi.Input; + dbSubnetGroupName?: pulumi.Input; /** * DB security group ID. Should be the same as primary instance. * If primary DB is instance of studion:Database, it can be accessed as