Skip to content

Commit

Permalink
feat(ec2): support for the credit configuration mode for burstable in…
Browse files Browse the repository at this point in the history
…stances (#28728)

In this PR, I have enabled the setting of the [credit configuration mode](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html#key-concepts) for EC2 instances and NAT instances in burstable performance instances.

```ts
// for EC2 instance
new Instance(stack, 'Instance', {
  vpc,
  machineImage: new AmazonLinuxImage(),
  instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.LARGE),
  creditSpecification: CpuCredits.STANDARD, // added
});

// for NAT instance
const natInstanceProvider = NatProvider.instance({
  instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.LARGE),
  machineImage: new AmazonLinuxImage(),
  creditSpecification: CpuCredits.STANDARD, // added
});
new Vpc(stack, 'VPC', {
  natGatewayProvider: natInstanceProvider,
});
```

Closes #19166.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
badmintoncryer committed Feb 29, 2024
1 parent fdacbe0 commit 3cbad4a
Show file tree
Hide file tree
Showing 28 changed files with 4,080 additions and 0 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3cbad4a

Please sign in to comment.