How to map EC2 instance to the correct product entry from the Price List Query?

16 views Asked by At

From using the AWS-SDK, I am unsure of how to map the Instance information to the applicable product entry from the Price List Query.

I am using NodeJS @aws-sdk/client-ec2 and @aws-sdk/client-pricing. I use the DescribeInstancesCommand to get the info on the instances. From that information, I have RegionCode, InstanceType, ImageId, plus other details.

Now I use GetProductsCommand and it returns a list of products with prices for the right instanceType and regionCode.

The struggle I am having is now how to map the instance to what product entry applies. How to map from Instance to the applicable product? Is there an API that links the two entries together?

Thanks.

0

There are 0 answers