What should we include in our new version of Infracost JSON format? #1278
alikhajeh1
started this conversation in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're thinking of updating our JSON format. We'd ❤️ to hear your feedback about the changes we have in mind (
infracost breakdown --path=path/to/code --format json
). These changes should make it simpler to write policies with tools like Open Policy Agent (OPA) or HashiCorp's Sentinel.we'll bump the
version
from0.2
to0.3
.resources
will havename
,type
, andaddress
fields. Previously thename
field contained the address. This change follows the convention in the Terraform plan JSON. For example:{ ... "name": "aws_instance.web_app" ...}
will now be stored as:{ ... "type": "aws_instance", "name": "web_app", "address": "aws_instance.web_app" ... }
{ ... "name": "module.my_api.module.metric_alarm_target_4xx.aws_cloudwatch_metric_alarm.this[0]" ...}
will now be stored as{ ... "type": "aws_cloudwatch_metric_alarm", "name": "this[0]", "address": "module.my_api.module.metric_alarm_target_4xx.aws_cloudwatch_metric_alarm.this[0]" ... }
Fields containing prices, costs, and quantities are now numbers instead of strings.
When possible, cost component configuration details will be expanded as a key value list.
{ "name": "Instance usage (Linux/UNIX, on-demand, m5.4xlarge)" ...}
will now be stored as{ "name": "Instance usage", "parameters": { "platform": "Linux/UNIX", "purchase_option": "on-demand", "instance_type": "m5.4xlarge" } ... }
A JSON schema for the JSON output is now published at https://github.com/infracost/infracost/blob/master/schema/infracost.schema.json.
Please let us know any ideas/improvements you want to see in our JSON format. What headaches has our old format caused that you want to see rectified?
Beta Was this translation helpful? Give feedback.
All reactions