Reputation: 1
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
Upvotes: 0
Views: 127
Reputation: 66
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.
Upvotes: 1