vantage-sh / terraform-provider-vantage

Terraform Modules for integrating AWS with Vantage
https://registry.terraform.io/modules/vantage-sh/vantage-integration/aws/latest
MIT License
7 stars 4 forks source link

Billing rules resource and data source #55

Closed whereandy closed 4 months ago

whereandy commented 4 months ago

In Rails, BigDecimals are expressed as strings in JSON. As a result, I have to define a different struct for data source billing rules: dataSourceBillingRuleModel. The difference between datasourceBillingRuleModel and billingRuleModel is that adjusted_rate and amount are handled as strings instead of floats.

mjcorwin commented 4 months ago

Overall code looks sane. 👍

Some tests would be appreciated, mostly from the perspective of validating argument combinations.

For example: https://github.com/vantage-sh/terraform-provider-vantage/blob/1dc6d0e368a5284dcbfd3d801a9c9206c183503b/vantage/billing_rule_resource.go#L81-L104

This indicates that if we specify credit/charge type subcategory is required, but overall the parameter is optional. Idk if its worth codifying that in terraform vs leaning into the api to return errors but clarity there would be helpful in defining supported functionality and related tests.

Don't have super strong opinions here as I'm just getting acquainted, and I'll defer to the team.