Open edonosotti opened 4 years ago
hi @edonosotti the resource alicloud_cs_managed_kubernetes does not export nat_gateway_id, but you can get it by data resource "alicloud_nat_gateways", here is the example https://www.terraform.io/docs/providers/alicloud/d/nat_gateways.html#example-usage
@demonwy thank you for the suggestion.
However, if you want to do something with the nat_gateway_id
in the same plan where the NAT Gateway is created, you would have to use the depends_on
directive on the data resource, which is not recommended as a best practice: https://www.terraform.io/docs/configuration/data-sources.html
@edonosotti ok, i see. another way, We recommend creating VPC/NAT/SNAT in advance, and then set new_nat_gateway to false on resource cs_managed_kubernetes. https://www.terraform.io/docs/providers/alicloud/r/cs_managed_kubernetes.html#new_nat_gateway
Thanks @demonwy
According to the documentation at: https://www.terraform.io/docs/providers/alicloud/r/cs_managed_kubernetes.html
alicloud_cs_managed_kubernetes
should export:When trying to get the NAT gateway ID to associate an EIP, I get this error (from
terraform validate
):