You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在CloudFormation模板中为EC2实例开启T2Unlimited模式?

Can I enable T2Unlimited for an EC2 instance in CloudFormation?

Yep, you absolutely can enable T2Unlimited for your t2.nano EC2 instance using CloudFormation—you just won’t find the setting directly in the AWS::EC2::Instance resource properties. Instead, you need to use the AWS::EC2::InstanceCreditSpecification resource to configure the CPU credit mode for your instance.

Here's how to set it up:

  • First, define your t2.nano EC2 instance as you normally would, specifying the InstanceType as t2.nano.
  • Add a separate AWS::EC2::InstanceCreditSpecification resource that references your EC2 instance's ID, and set the CPUCredits property to "unlimited".

Example CloudFormation YAML template:

AWSTemplateFormatVersion: "2010-09-09"
Resources:
  MyT2NanoInstance:
    Type: AWS::EC2::Instance
    Properties:
      InstanceType: t2.nano
      ImageId: ami-xxxxxxx # Replace with your desired AMI ID
      # Add other required properties like KeyName, SecurityGroups, etc.

  MyInstanceCreditSpec:
    Type: AWS::EC2::InstanceCreditSpecification
    Properties:
      InstanceId: !Ref MyT2NanoInstance
      CPUCredits: "unlimited"

Why this works:

The T2Unlimited mode is managed as a separate credit specification configuration for EC2 instances, not a core property of the instance itself. That’s why you won’t see it listed in the AWS::EC2::Instance documentation—this setting lives in the dedicated credit specification resource instead.

Once deployed, this template will launch a t2.nano instance with T2Unlimited mode enabled, allowing it to burst beyond its baseline CPU capacity whenever needed.

内容的提问来源于stack exchange,提问作者Yuki Inoue

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:43:37