View a markdown version of this page

Use ConfirmProductInstance with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use ConfirmProductInstance with a CLI

The following code examples show how to use ConfirmProductInstance.

CLI
AWS CLI

To confirm the product instance

The following confirm-product-instance example determines whether the specified product code is associated with the specified instance.

aws ec2 confirm-product-instance \ --product-code 774F4FF8 \ --instance-id i-1234567890abcdef0

Output:

{ "OwnerId": "123456789012" }

For more information, see Paid AMIs in the AWS Marketplace for Amazon EC2 instances in the Amazon EC2 User Guide.

PowerShell
Tools for PowerShell V4

Example 1: This example determines whether the specified product code is associated with the specified instance.

Confirm-EC2ProductInstance -ProductCode 774F4FF8 -InstanceId i-12345678
Tools for PowerShell V5

Example 1: This example determines whether the specified product code is associated with the specified instance.

Confirm-EC2ProductInstance -ProductCode 774F4FF8 -InstanceId i-12345678