RDS:
- aurora-test (Regional cluster)
- aurora-test-instance-1 (Writer instance)
> nslookup aurora-test.cluster-ro-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
> nslookup aurora-test.cluster-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
> nslookup aurora-test-instance-1.cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
RDS:
- aurora-test (Regional cluster)
- aurora-test-instance-1 (Writer instance)
- aurora-test-reader (Reader instance)
> nslookup aurora-test.cluster-ro-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 52.49.243.230 --> points to reader instance
> nslookup aurora-test.cluster-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
> nslookup aurora-test-instance-1.cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
> nslookup aurora-test-reader.cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 52.49.243.230 --> points to reader instance
RDS:
- aurora-test (Regional cluster)
- aurora-test-instance-1 (Writer instance)
- aurora-test-reader (Reader instance
- aurora-test-reader-2 (Reader instance)
> nslookup aurora-test.cluster-ro-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 52.49.243.230 --> points to reader instance
> nslookup aurora-test.cluster-ro-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 34.243.226.163 --> points to second reader instance
> nslookup aurora-test.cluster-cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
> nslookup aurora-test-instance-1.cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 63.34.212.43 --> points to master instance
> nslookup aurora-test-reader.cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 52.49.243.230 --> points to reader instance
> nslookup aurora-test-reader-2.cytaifhqfdcq.eu-west-1.rds.amazonaws.com
...
Address: 34.243.226.163 --> points to second reader instance
- cluster endpoint points always to master instance (writer)
- cluster read only endpoint points to any of reader instances (load balanced)
ASCII
[M] [R] [R]
| | |
| \___/
write | | read
\_____/
|
Terraform Error
The "count" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around
│ this, use the -target argument to first apply only the resources that the count depends on.
My solution maybe not the best but works is to decouple it and not reference needed variable/local/property directly but through remote state
so in XYZ stack
this way it is decoupled