Skip to content
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

azurerm_cost_management_scheduled_action - New resource #21325

Merged
merged 16 commits into from
Apr 20, 2023

Conversation

aristosvo
Copy link
Collaborator

@aristosvo aristosvo commented Apr 6, 2023

Fixes #21198

Acceptance Tests

Screenshot 2023-04-12 at 21 46 29

TODO

  • Docs
  • Extra tests

@aristosvo aristosvo force-pushed the costmanagement/scheduledaction branch from e110076 to a0a6103 Compare April 14, 2023 07:15
@aristosvo
Copy link
Collaborator Author

Rebased, tests still passing

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @aristosvo! I've done a first pass through and left some comments and questions in line. Once those are resolved we can take another look through and run the tests.

}

props := scheduledactions.ScheduledAction{
Kind: utils.ToPtr(scheduledactions.ScheduledActionKindEmail),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other useful scheduled action kinds that might want to be exposed in future? If so it might be good to specify that in the resource name, i.e. azurerm_subscription_cost_management_email_scheduled_action and to remove the email prefix for all of the arguments.

If not happy to the keep the name as is since otherwise they get a bit long 😅

Copy link
Collaborator Author

@aristosvo aristosvo Apr 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same API is also used to create azurerm_cost_anomaly_alert (Kind=Insight Alert), you could argue that this one is a azurerm_scheduled_cost_email or azurerm_cost_management_scheduled_view_email.., the question here is what the scope is of this resource and what Microsoft seems fit long term. It might be that this resource is extended to have more Kinds, or that it might extend to email multiple resource types: next to views also CSV files based on a query, whatsoever.

In the API docs they are also talking about reports, in the Cost Management Docs it is referred to as scheduled_alerts..

Options:

  • azurerm_cost_management_scheduled_view_email (Most precise technical description)
  • azurerm_cost_management_scheduled_report (Best functional description IMHO)
  • azurerm_cost_management_scheduled_alert (Closest to docs, confusing to me tbh)

Your choice 😵

Co-authored-by: stephybun <steph@hashicorp.com>
aristosvo and others added 5 commits April 17, 2023 20:13
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: stephybun <steph@hashicorp.com>
Co-authored-by: stephybun <steph@hashicorp.com>
@aristosvo aristosvo force-pushed the costmanagement/scheduledaction branch from 35ec5ff to 77d3fc9 Compare April 17, 2023 19:24
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @aristosvo! I have one final remark about some (I think) unused files. But other than that this looks like it's good to go!

internal/services/costmanagement/resourceids.go Outdated Show resolved Hide resolved
@aristosvo
Copy link
Collaborator Author

Thanks so much @aristosvo! I have one final remark about some (I think) unused files. But other than that this looks like it's good to go!

Hi @stephybun! Thanks! What is your opinion about the name of the resource, is that something that is still open for discussion or should we leave it like this for now?

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name is okay as is for now, if we need more granularity in the future then it shouldn't conflict with anything... hoping that doesn't come bite me on the bum later on 😅
Thanks again @aristosvo! LGTM 🌻

@stephybun stephybun merged commit 83613a6 into hashicorp:main Apr 20, 2023
@github-actions github-actions bot added this to the v3.53.0 milestone Apr 20, 2023
stephybun added a commit that referenced this pull request Apr 20, 2023
@aristosvo aristosvo changed the title azurerm_subscription_cost_management_scheduled_action - New resource azurerm_cost_management_scheduled_action - New resource Apr 20, 2023
@github-actions
Copy link

This functionality has been released in v3.53.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Jun 2, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Azure Cost Management saved views and subscriptions
2 participants