Azure Postgres Server getting recreated when trying to create new subnet under same VNET using Terraform scripts - postgresql

I have created Azure Postgres Single Server with firewall and VNET rule for one subnet.(173.30.0.0/24)
Now I am trying to create another subnet(173.30.5.0/27) inside the same VNET, but while doing so the Postgres Server is getting recreated which deletes all available db instances.
I am using terraform scripts for creation of resources.
Can anyone explain why addition of new subnet is recreating Postgres Server.

Related

DMS Migration MongoDB source and RDS Postgres as destination

I want to start existing and ongoing replication from source MongoDB to destination RDS Postgres.
All the security network is done and successful.
RDS VPC and DMS VPC are connected using VPC peering, target endpoint test connection status is successful
DMS VPC IP is whitelisted in another AWS account MongoDB server, source endpoint test connection status is successful
In the Endpoint schemas section both database schemas are visible.
Created a DMS migration task to start the migration of one document of MongoDB to Postgres Database.
Premigration assessments were successful.
Empty scheme with the MongoDB schema name got created in PostgresDB.
The table awsdms_apply_execution is also empty in Postgres DB.
But the task shows running with error and error, and cloud watch logs also show no error.

Connect Postgres db hosted in azure storage using docker

I am trying to connect the postgres database hosted in azure storage account from within the flyway, flyway is running as docker image in docker container
docker run --rm flyway/flyway -url=jdbc:postgresql://postgres-azure-db:5432/postgres -user=user -password=password info but I am getting the error ERROR: Unable to obtain connection from database
Any idea/doc-link would be helpful
You have a similar error (different context, same general solution) in this flyway issue
my missing piece for reaching private Cloud SQL instances from private worker pools in Cloud Build was a missing network route.
The fix is ensuring the Service Networking VPC peer has the "Export custom routes" setting enabled, and that the Cloud Router advertises the route.
In your context (Azure), see "Quickstart: Use Azure Data Studio to connect and query PostgreSQL"
You can also try with a local Postgres instance first, and Azure Data Studio, for testing.
After exploring few option, I implemented the flyway using the Azure container instance. Create an ACI to store the flyway docker image and to execute the commands inside ACI, Also created a file share to keep the config file and sql scripts.
All these resource (Storage, ACI, file share) I created via the terraform scripts which is being triggered from Jenkins.

Database name in an AWS Arora Postgres Serverless cluster

I have created a new Arora Serverless PostgreSQL cluster and I am trying to use the Query Editor.
What do I enter in the Database Name text field? Where do I find the name of the database? Is it the same are the cluster name?
Note: I have enables the Data API when I created the DB
Creation of database is an optional setting when you create your Aurora serverless:
If you haven't done that you have to create your db using traditional way.
This is the name of the database within the cluster, not any hostname or individual node. The target hosts are specified in Database instance or cluster label.
When you created your database cluster you could optionally specify a database that would be created on the host. This default database is viewable from within the console interface. Otherwise if you created the target database after the cluster launched, specify that database name instead.

Amazon RDS Postgres name or service not known

I have 2 Amazon EC2 instances. I am using one for development. I started a new one that I want to get working properly so I can use this cleaner one to make an AMI. I am using Django with a Postgres backend in an RDS instance. The RDS instance is running Postgresql 9.4.4. The development EC2 instance (which is the one that works) is running Postgresql 9.3.9. The new instance is running Postgresql 9.3.10.
On the development instance I have no trouble connecting to and using the RDS instance with the command line:
psql --host django.xxxxxxxxx.us-east-1.rds.amazonaws.com --port 5432 --username django_login --dbname django_db
But if I use the same command on the new instance, I get
psql: could not translate host name "django.xxxxxxxxx.us-east-1.rds.amazonaws.com" to address: Name or service not known
Both EC2 instances are in the same security group (launch-wizard-1). The RDS has a security group with all TCP, all UDP and all IMCP set with launch-wizard-1 as the source.
The development instance is in us-east-1d. The new instance is in us-east-1c. The RDS instance is in us-east-1d. I suspect that might be the problem but as I understand the RDS documentation it should be fine. If however, that is the problem, do you know how to change the Availability Zone of an EC2 instance?
I have tried this with the RDS instance set to private and then to public. It did not make a difference.
Any ideas will be appreciated.
The problem was as I had suspected. The instance was in a different subnet. I made an ami from the instance in us-east-1c, made a new instance in the us-east-1d subnet from the ami. Now I can connect from the new instance.
BTW - It is not immediately obvious when you create an instance that you should set the subnet to match your other instances. Look for that option on the instance configuration page.

How to connect a running container(tomcat) on amazon ec2 to RDS postgres

In aws, I have an amazon linux instance running with docker installed and my app running as a container. It's running in tomcat. However I need to connect it to my database.
I have made this work with a postgres container earlier doing this:
docker run --link <dbcontainername>:db -P -d tomcat-image
But to have the database more reliable it is wanted to use amazon RDS instead.
I have created a VPC with two subnets which both the instance and the RDS uses
And they are also both in the same Security Group.
I am able to access the tomcat fine through the public ip, but it throws errors because it isn't connected to the db.
Networking is not my strong suit, so there might be something there I am missing, but I find it hard to find any text describing this process without mentioning Elastic bean stalk.(It is my impression that it should be possible to do everything EBS does, manually)
There's a similar question asked here about 8 months ago, but he didn't get any responses so I'm trying again.