【问题标题】:How to power on AWS instance with Terraform如何使用 Terraform 启动 AWS 实例
【发布时间】:2021-12-26 08:23:32
【问题描述】:

抱歉,我是 Terraform 的新手。

我使用 Terraform 成功创建了 AWS 实例。 然后我在 AWS Web 管理控制台中关闭实例。

如何使用 Terraform 启动实例?

【问题讨论】:

    标签: amazon-web-services terraform terraform-provider-aws


    【解决方案1】:

    您必须使用 local-exec 来运行 AWS CLI 的 start-instances

    【讨论】:

      【解决方案2】:

      您可以使用 aws_instance terraform 资源的 instance_type 值。

      instance_type : (Optional) The instance type to use for the instance.  
      Updates to this field will trigger a stop/start of the EC2 instance.
      

      【讨论】:

        猜你喜欢
        • 2021-11-15
        • 1970-01-01
        • 1970-01-01
        • 2023-03-31
        • 2020-03-10
        • 1970-01-01
        • 1970-01-01
        • 2018-11-03
        • 1970-01-01
        相关资源
        最近更新 更多