terraform-provider-aws
terraform-provider-aws copied to clipboard
[New]: AWS Cost Optimization Hub
Description
Cost Optimization Hub is a new AWS Billing and Cost Management feature that helps you consolidate and prioritize cost optimization recommendations across your AWS Organizations member accounts and AWS Regions, so that you can get the most out of your AWS spend.
Requested Resource(s) and/or Data Source(s)
- aws_cost_optimization_hub_config
Potential Terraform Configuration
No response
References
Announcement: https://aws.amazon.com/about-aws/whats-new/2023/11/cost-optimization-hub/ Product Page: https://aws.amazon.com/aws-cost-management/cost-optimization-hub/ AWS CLI since 1.30.7: https://github.com/aws/aws-cli/blob/0f81aeeda03b78d9b6eb9d439cc6213c49ad15b9/.changes/1.30.7.json#L14
Would you like to implement a fix?
No
Community Note
Voting for Prioritization
- Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
- Please see our prioritization guide for information on how we prioritize.
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
- If you are interested in working on this issue, please leave a comment.
- If this would be your first contribution, please review the contribution guide.
I am trying to work on creating resources for this, but I feel it is better to have two different resources. One for EnrollmentStatus and one for Preferences as that is how the API is structured - https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Operations_Cost_Optimization_Hub.html
Something like
- aws_costoptimiztionhub_enrollment_status
- aws_costoptimizationhub_preferences
After working on this a bit more and thinking about it, I feel a single resource makes more sense. But calling the resource aws_costoptimizationhub_enrollment seems more appropriate as that aligns neatly with the idea that the resource creation, "creates" an "enrollment". That is, when the enrollment resource is "Created" then the account enrolls for cost optimization hub, with the provided preferences. When the enrollment resource is "Destroyed" and then the account unenrolls.
But if the enrollment_status is a resource, then that is not accurate, as destroying the resource, does not mean there is no status. It just means that the status is Inactive.
Moreover, combining them also goes well with the fact that the concept of "preferences" does not exist for an account not enrolled into Cost Optimization Hub. So it is more logical to make the preferences be the attributes of the "enrollment" resource rather than as preferences being a separate resource by itself.
Looking forward for this one!