我们能否在 Terraform 输出中获得 AWS EC2 状态 1/2 或 2/2 状态?
Can we get AWS EC2 status 1/2 or 2/2 status in terraform output?
我们能否在 terraform 输出中获得 AWS EC2 状态 1/2 或 2/2 状态?我们可以 运行 terraform 通过 cron 销毁吗?
数据来源aws_instance does not provide such information. Thus, you could create custom data source by means of external.
custom/external 数据源会调用您自己的程序或脚本 来查询 EC2 实例状态,例如使用 describe-instance-status 和 return 到 TF 以供进一步使用。
是的,您可以通过 cron 运行 TF。
我们能否在 terraform 输出中获得 AWS EC2 状态 1/2 或 2/2 状态?我们可以 运行 terraform 通过 cron 销毁吗?
数据来源aws_instance does not provide such information. Thus, you could create custom data source by means of external.
custom/external 数据源会调用您自己的程序或脚本 来查询 EC2 实例状态,例如使用 describe-instance-status 和 return 到 TF 以供进一步使用。
是的,您可以通过 cron 运行 TF。