-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Budgets Resource and Data Source #47
Conversation
cost_report_token = vantage_cost_report.demo_report.token | ||
periods = [ | ||
{ | ||
start_at = "2023-12-01" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format for the dates is YYYY-MM-DD, not ISO-8601.
return dst | ||
} | ||
|
||
func applyBudgetPayload(ctx context.Context, isDataSource bool, src *modelsv2.Budget, dst *budgetModel) diag.Diagnostics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@conner n.b., unlike what you did, the model is not the receiver of this function, because i'm using the autogenerated model, (budgetModel
is a resource_budget.BudgetModel
) and can't attach methods to it.
// both the data source and the resource | ||
type budgetModel resource_budget.BudgetModel | ||
type budgetPerformanceModel resource_budget.PerformanceValue | ||
type budgetPeriodResourceModel struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hate that we need separate ways to describe the period depending on whether it is for a data source or a resource, but cant find a better workaround for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a comment to 🧹, but lgtm. ship it
vantage/budget_resource_model.go
Outdated
} | ||
|
||
if src.Periods != nil { | ||
// var l types.List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹
needs tests. bump vantage-go examples tf fmt cleanup
No description provided.