Any recommendations on how to wait for an AWS RDS database host to be provisioned before creating a database or user? To accomplish this, I am attempting to use depends_on parameter in order for it to wait for the RDS database to be provisioned first. It seems the provider cannot wait for the resource.
I get the following error when running this:
The provider argument name "depends_on" is reserved for use by Terraform in a future version.
--- Terraform Plan Snippet ----
# Provision AWS PostgreSQL Dev Database
resource "aws_db_instance" "dev_db" {
identifier = "dev"
allocated_storage = 100
storage_type = "gp2"
engine = "postgres"
engine_version = "10.9"
port = 1433
instance_class = "db.t3.medium"
name = "dev"
username = "dev"
password = "mydevpassword"
parameter_group_name = "postgress10"
tags = {
Name = "dev"
}
skip_final_snapshot = true
}
# Setup PostgreSQL Provider After RDS Database is Provisioned
provider "postgresql" {
host = "${aws_db_instance.dev_db.address}"
port = 1433
username = "dev"
password = "mydevpassword"
depends_on = [aws_db_instance.dev_db]
}
# Create App User
resource "postgresql_role" "application_role" {
name = "dev_appuser"
login = true
password = "myappuserpassword"
encrypted_password = true
depends_on = [aws_db_instance.dev_db]
}
# Create Database
resource "postgresql_database" "dev_db" {
name = "mydatabase1"
owner = "dev"
template = "template0"
lc_collate = "C"
connection_limit = -1
allow_connections = true
depends_on = [aws_db_instance.dev_db]
}
depends_on = [aws_db_instance.dev_db]
– Max Smolensdepends_on
altogether do you still have trouble? – Max Smolens