Skip to content
v2.278.0

CpuCredits Enum ​

Provides the options for specifying the CPU credit type for burstable EC2 instance types (T2, T3, T3a, etc).

Example ​

ts
declare const vpc: ec2.Vpc;

const instance = new ec2.Instance(this, 'Instance', {
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO),
  machineImage: ec2.MachineImage.latestAmazonLinux2(),
  vpc: vpc,
  creditSpecification: ec2.CpuCredits.STANDARD,
});
python
# vpc: ec2.Vpc


instance = ec2.Instance(self, "Instance",
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO),
    machine_image=ec2.MachineImage.latest_amazon_linux2(),
    vpc=vpc,
    credit_specification=ec2.CpuCredits.STANDARD
)
java
Vpc vpc;


Instance instance = Instance.Builder.create(this, "Instance")
        .instanceType(InstanceType.of(InstanceClass.T3, InstanceSize.MICRO))
        .machineImage(MachineImage.latestAmazonLinux2())
        .vpc(vpc)
        .creditSpecification(CpuCredits.STANDARD)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;


var instance = new Instance(this, "Instance", new InstanceProps {
    InstanceType = InstanceType.Of(InstanceClass.T3, InstanceSize.MICRO),
    MachineImage = MachineImage.LatestAmazonLinux2(),
    Vpc = vpc,
    CreditSpecification = CpuCredits.STANDARD
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc


instance := ec2.NewInstance(this, jsii.String("Instance"), &InstanceProps{
	InstanceType: ec2.InstanceType_Of(ec2.InstanceClass_T3, ec2.InstanceSize_MICRO),
	MachineImage: ec2.MachineImage_LatestAmazonLinux2(),
	Vpc: vpc,
	CreditSpecification: ec2.CpuCredits_STANDARD,
})

Members ​

MemberDescription
STANDARDStandard bursting mode.
UNLIMITEDUnlimited bursting mode.

Referenced by ​

  • InstanceProps.creditSpecificationcredit_specificationcreditSpecificationCreditSpecificationCreditSpecification
  • LaunchTemplateProps.cpuCreditscpu_creditscpuCreditsCpuCreditsCpuCredits
  • NatInstanceProps.creditSpecificationcredit_specificationcreditSpecificationCreditSpecificationCreditSpecification