跨多个云提供商启动/停止实例 [英] Start/stop instances across multiple cloud providers

查看:14
本文介绍了跨多个云提供商启动/停止实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设使用 Terraform 构建的跨多个云提供商帐户(AWS、Azure 和 GC)的云基础架构.有没有办法使用 Terraform 重启实例?如果没有,人们如何轻松、集中地重新启动他们使用 Terraform 创建的实例?

Assuming a cloud infrastructure across multiple cloud provider accounts (AWS, Azure and GC) built with Terraform. Is there any way to reboot instances using Terraform? If not, how do people easily and centrally reboot their instances created with Terraform?

谢谢!

推荐答案

Terraform 不提供重启实例的能力.充其量,您可以污染资源,这意味着 terraform 将销毁并重新创建(这显然与重新启动不同).Terraform 不是管理实例生命周期的正确工具.

Terraform does not provide capacity to reboot your instances. At best, you could taint a resource, that means that terraform will destroy and recreate (which is obviously not the same the rebooting). Terraform is not the right tool to manage the lifecycle of your instance.

通常,最佳做法是使用 AWS 上的 cloudwatch 自动重启您的实例.您需要对其进行配置以检测不健康的实例.我猜其他云提供商也有类似的功能.

Usually, the best practice is to get your instance automatically rebooted, using cloudwatch on AWS. You need to configure it to detect unhealthy instances. I guess other cloud providers have a similar feature.

如果您需要手动执行此操作,下一步将是使用云 API(例如 aws cli)来执行此操作.我不知道有什么工具可以让您跨云提供商集中执行此操作.

If you need to do it manually, next step would be to use the cloud API (such as aws cli) to perform this action. I am not aware of a tool that let you do that across cloud providers centrally.

这篇关于跨多个云提供商启动/停止实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆