【发布时间】:2016-11-28 01:21:51
【问题描述】:
我正在尝试声明以下 Terraform 提供程序:
provider "mysql" {
endpoint = "${aws_db_instance.main.endpoint}:3306"
username = "root"
password = "root"
}
我收到以下错误:
Error refreshing state: 1 error(s) occurred:
* dial tcp: lookup ${aws_db_instance.main.endpoint}: invalid domain name
Terraform 似乎没有在我的端点字符串上执行插值,但我在文档中没有看到任何关于此的内容——什么给出了?
【问题讨论】:
-
您对
aws_db_instancemain的资源定义是什么样的? -
此外,mysql 提供程序文档中的示例似乎暗示
aws_db_instance...endpoint将端口作为输出的一部分返回,因此您不需要再次附加它。 terraform.io/docs/providers/mysql/index.html
标签: terraform