0
votes

I want to create multi-AZ Apsara DB instance using terraform and for this I referred below URLs but it didn't work. It created DB instance only in 1 AZ.

https://www.terraform.io/docs/providers/alicloud/r/db_instance.html

https://www.terraform.io/docs/providers/alicloud/d/zones.html

If anyone knows then please help me.

Regards,

Chintu

1
Hi! Welcome to Stack Overflow. Can you add a minimally, reproducible example? What is the error you are getting?mhovd

1 Answers

1
votes

First you need to get the availability_zone which supports multizone. You can get it in data from:

data "alicloud_zones" "def_zone" {
  available_resource_creation = "Rds"
  multi = true
  network_type = "Vpc"
  output_file = "xt.txt"
}

After that all you need to do is to use that found multizone ID. As:

availability_zone = data.alicloud_zones.def_zone.zones.0.multi_zone_ids.0

You may also wanna look into your xt.txt file created to see the structure of the data created by def_zone.