How to Get the Product Code from Within an Instance
A running Amazon EC2 instance can determine if has an Amazon DevPay product code. The instance retrieves the product code similarly to how retrieves other metadata. For more information about retrieving metadata, see Instance Metadata.
To retrieve a product code, query a web server with this REST-like API call:
Amazon EC2 returns a response similar to the following: