outsideris / citizen

A Private Terraform Module/Provider Registry
Mozilla Public License 2.0
625 stars 84 forks source link

DynamoDB back end? #98

Open richardgavel opened 2 years ago

richardgavel commented 2 years ago

Since Citizen is already AWS aware (using S3 as a backend for its packages), I wonder how hard it would be to use DynamoDB as a DB, borrowing from the implementation to use MongoDB. I know AWS does support managed MongoDB (via DocumentDB). However, that can be somewhat expensive, especially in a HA scenario, since the smallest size is a t3.medium. Especially since more than likely, the server is going to see very little activity. A serverless DB store might be a great option to have.

joeykhashab commented 2 years ago

Has anyone had anyone had luck trying to get AWS DocumentDB to work? When I pass in the URL for documentDB for CITIZEN_MONGO_DB_URI and I just get a connection refused when citizen loads up.

richardgavel commented 2 years ago

I did get DocumentDB to work (in my prior job, so don't have access to see details anymore). Are you sure you had the necessary security groups set up to allow port 27017 to communicate from citizen server to documentdb?

joeykhashab commented 2 years ago

interesting, yeah the security groups were fine. I manually logged into the ec2 instance that citizen was running on and used a "nc" command to verify the connection. The nc command worked.

Were you using 0.4.0 version or the master version of citizen?

did you have to create a database in DocumentDB manually before citizen connects to it?

richardgavel commented 2 years ago

Yes, i created the database ahead of time. And this was a fairly old version of citizen.

On Fri, Apr 1, 2022 at 8:52 AM joeykhashab @.***> wrote:

interesting, yeah the security groups were fine. I manually logged into the ec2 instance that citizen was running on and used a "nc" command to verify the connection. The nc command worked.

Were you using 0.4.0 version or the master version of citizen?

did you have to create a database in DocumentDB manually before citizen connects to it?

— Reply to this email directly, view it on GitHub https://github.com/outsideris/citizen/issues/98#issuecomment-1085927106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5SUDYWE762QIGGHWL4PELVC35P7ANCNFSM5R7RW46A . You are receiving this because you authored the thread.Message ID: @.***>

atomixer commented 2 years ago

@joeykhashab I don't think Documentdb will work with citizen because Prisma only supports Mongodb version 4.2 and above. Documentdb is currently at version 4.0 so unless Amazon adds support for the newer versions of Mongodb, documentdb isn't really an option. Prisma adding support for Mongo v4.0 also seems unlikely.

I was able to hookup the citizen server (v6.0) with a Documentdb instance (v4.0) but I kept running into errors when I tried to version modules.

richardgavel-ordinaryexperts commented 2 years ago

Yeah, when I got it to work, it was a version of Citizen so old that it didn't even have the HCL2 support in there, so at best it was 0.3.3. Looks like Prisma was added with 0.6.0. So it's possible that earlier versions might work.

richardgavel-ordinaryexperts commented 1 year ago

DocumentDB now apparently supports the MongoDB 5.0 compatability: https://docs.aws.amazon.com/documentdb/latest/developerguide/compatibility.html