diff --git a/ec/acc/deployment_autoscaling_test.go b/ec/acc/deployment_autoscaling_test.go index 9f4016597..c92810dec 100644 --- a/ec/acc/deployment_autoscaling_test.go +++ b/ec/acc/deployment_autoscaling_test.go @@ -46,30 +46,44 @@ func TestAccDeployment_autoscaling(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resName, "elasticsearch.#", "1"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.autoscale", "true"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.#", "3"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.#", "5"), resource.TestCheckResourceAttrSet(resName, "elasticsearch.0.topology.0.instance_configuration_id"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.id", "hot_content"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size", "1g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.id", "cold"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size", "0g"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.size_resource", "memory"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.zone_count", "1"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.autoscaling.#", "1"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.autoscaling.0.max_size", "8g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.0.autoscaling.0.max_size", "58g"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.id", "ml"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.size", "1g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.id", "frozen"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.size", "0g"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.size_resource", "memory"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.zone_count", "1"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.autoscaling.#", "1"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.autoscaling.0.max_size", "4g"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.autoscaling.0.min_size", "1g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.1.autoscaling.0.max_size", "120g"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.id", "warm"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.size", "2g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.id", "hot_content"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.size", "1g"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.size_resource", "memory"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.zone_count", "1"), resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.autoscaling.#", "1"), - resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.autoscaling.0.max_size", "15g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.2.autoscaling.0.max_size", "8g"), + + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.id", "ml"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.size", "1g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.size_resource", "memory"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.zone_count", "1"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.autoscaling.#", "1"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.autoscaling.0.max_size", "4g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.3.autoscaling.0.min_size", "1g"), + + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.4.id", "warm"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.4.size", "2g"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.4.size_resource", "memory"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.4.zone_count", "1"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.4.autoscaling.#", "1"), + resource.TestCheckResourceAttr(resName, "elasticsearch.0.topology.4.autoscaling.0.max_size", "15g"), resource.TestCheckResourceAttr(resName, "kibana.#", "0"), resource.TestCheckResourceAttr(resName, "apm.#", "0"), diff --git a/ec/acc/testdata/deployment_autoscaling_1.tf b/ec/acc/testdata/deployment_autoscaling_1.tf index 48baebc41..c5db2fcef 100644 --- a/ec/acc/testdata/deployment_autoscaling_1.tf +++ b/ec/acc/testdata/deployment_autoscaling_1.tf @@ -12,6 +12,18 @@ resource "ec_deployment" "autoscaling" { elasticsearch { autoscale = "true" + topology { + id = "cold" + size = "0g" + zone_count = 1 + } + + topology { + id = "frozen" + size = "0g" + zone_count = 1 + } + topology { id = "hot_content" size = "1g" @@ -38,4 +50,4 @@ resource "ec_deployment" "autoscaling" { } } } -} \ No newline at end of file +} diff --git a/ec/acc/testdata/deployment_autoscaling_2.tf b/ec/acc/testdata/deployment_autoscaling_2.tf index 7dc2c000b..d3602c960 100644 --- a/ec/acc/testdata/deployment_autoscaling_2.tf +++ b/ec/acc/testdata/deployment_autoscaling_2.tf @@ -12,6 +12,18 @@ resource "ec_deployment" "autoscaling" { elasticsearch { autoscale = "false" + topology { + id = "cold" + size = "0g" + zone_count = 1 + } + + topology { + id = "frozen" + size = "0g" + zone_count = 1 + } + topology { id = "hot_content" size = "1g" @@ -38,4 +50,4 @@ resource "ec_deployment" "autoscaling" { } } } -} \ No newline at end of file +}