- Newest
- Most votes
- Most comments
Unfortunately, there isn't a direct way to detect if a user has a free trial for a specific AMI-based product using the AWS CDK. The CDK doesn't provide built-in functionality to check for free trial status of AWS Marketplace products.
However, you can consider a few alternative approaches:
-
Use AWS Billing and Cost Management API: You could potentially use the Free Tier API, specifically the GetFreeTierUsage operation, to check the usage of free tier resources. This API allows you to retrieve information about free tier usage, including for EC2 instances. However, this would require additional setup and wouldn't be directly integrated into your CDK stack.
-
Manual configuration: You could create a configuration parameter in your stack that indicates whether the user is on a free trial or not. This would require manual input but allows you to adjust your EC2 capacity accordingly.
-
Assume no free trial: Given the limitations, you might want to design your stack assuming no free trial is available. This ensures that your infrastructure can handle the expected load without relying on free tier resources.
It's important to note that even if a product has a free trial in AWS Marketplace, it typically only applies to the software pricing. The user would still be responsible for the underlying EC2 instance costs. Therefore, basing your EC2 capacity solely on the presence of a free trial may not be the most reliable approach.
If you need to make decisions based on free trial status, you might need to implement a separate process outside of the CDK deployment to check this information and then pass it into your stack as a parameter.
Sources
Free trials of products listed on AWS Marketplace - AWS Marketplace
Using the Free Tier API - AWS Billing
answered a year ago
Relevant content
asked a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
