简体   繁体   English

使用Terraform启动AWS保留实例

[英]Launching AWS reserved Instances with Terraform

I want to create reserved instances for long periods of time like eg with one year run time. 我想长时间创建保留实例,例如一年运行时间。 Does anybody know if Terraform allows to create such reserved instances in AWS? 有人知道Terraform是否允许在AWS中创建此类保留实例吗?

I could now find anything in the Terraform documentation. 我现在可以在Terraform文档中找到任何内容。

Reserved instances in AWS work on a first come first served basis. AWS中的预留实例按先到先得的原则运行。 If you create any on demand instance that happens to match the criteria of your reserved instance then it will use your reserved instance quota first. 如果您创建的任何按需实例恰好与您保留的实例的条件匹配,那么它将首先使用您的保留实例配额。

The AWS docs also explain this: AWS文档也解释了这一点:

Reserved Instances are automatically applied to running On-Demand Instances provided that the specifications match. 如果规范匹配,则预留实例将自动应用于运行按需实例。 If you have no running On-Demand Instances that match the specifications of your Reserved Instance, the Reserved Instance is unused until you launch an instance with the required specifications. 如果没有与预留实例的规范匹配的正在运行的按需实例,则在您启动具有所需规范的实例之前,预留实例将不使用。

If you're launching an instance to take advantage of the billing benefit of a Reserved Instance, ensure that you specify the following information during launch: 如果要启动实例以利用预留实例的计费优势,请确保在启动期间指定以下信息:

  • Platform: You must choose an Amazon Machine Image (AMI) that matches the platform (product description) of your Reserved Instance. 平台:您必须选择与预留实例的平台(产品描述)匹配的Amazon Machine Image(AMI)。 For example, if you specified Linux/UNIX, you can launch an instance from an Amazon Linux AMI. 例如,如果您指定了Linux / UNIX,则可以从Amazon Linux AMI启动实例。

  • Instance type: Specify the same instance type as your Reserved Instance; 实例类型:指定与预留实例相同的实例类型; for example, t2.large. 例如,t2.large。

  • Availability Zone: If you purchased a Reserved Instance for a specific Availability Zone, you must launch the instance into the same Availability Zone. 可用区:如果您为特定可用区购买了预留实例,则必须将实例启动到同一可用区。 If you purchased a regional Reserved Instance, you can launch your instance into any Availability Zone. 如果您购买了区域预留实例,则可以将实例启动到任何可用区。

  • Tenancy: The tenancy of your instance must match the tenancy of the Reserved Instance; 租赁:您的实例的租期必须与预留实例的租期相匹配; for example, dedicated or shared. 例如,专用或共享。 For more information, see Dedicated Instances. 有关更多信息,请参阅专用实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM