aws / aws/aws-cdk

(aws-ec2): Expose instance properties on InstanceType

Open
#12,022 4 comments 4 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 effort/medium feature-request feature/service-integration p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

There are many supporting properties unique to EC2 [InstanceType](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.InstanceType.html). Some AWS supporting services are conditioned on these properties so they should be readily available to developers in the framework.

### Use Case

The specific usecase I have in mind is [Cloudwatch monitoring of SageMaker endpoints](https://docs.aws.amazon.com/sagemaker/latest/dg/monitoring-cloudwatch.html), from there:

> CPUUtilization: The percentage of CPU units that are used by the containers on an instance. The value can range between 0 and 100, and is multiplied by the number of CPUs. For example, if there are four CPUs, CPUUtilization can range from 0% to 400%

This requires the manual process of looking up the relevant information for your current instance type on the web and hard-coding it in the CDK if you want to properly condition Cloudwatch alarms on these metrics. An ideal CX would be one where the developer doesn't need to leave CDK to get the information required.

### Proposed Solution

There could be some static mapping or interface of various instance properties which are keyed on [InstanceType](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.InstanceType.html). As a first step some of the properties from https://aws.amazon.com/ec2/instance-types/ could be incorporated with the intent to expand to all types + properties in the future.

---

This is a :rocket: Feature Request

Contributor guide

Open the contributing guide

Research direction

Start with the EC2 InstanceType API and the AWS EC2 instance-types reference linked in the issue. Determine which instance properties and mapping scope should be supported, including the CPU information needed for SageMaker CloudWatch monitoring. Done means developers can access the selected properties from InstanceType without external lookups.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.