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

AWS_CE_COST_CATEGORY: fix effective start being changed on update despite no current change #30369

Conversation

huetterma
Copy link
Contributor

Description

Fixed effective_start date being reset to the start of the current month. Effective_start date is required (see API documentation in the references). If the effective_start has not been changed by the current change, terraform passes nil which results on AWS side to use the default value (first day of current month).

Relations

Closes #29044

References

AWS API Reference

The aws sdk states:

The Cost Category's effective start date. It can only be a billing start
date (first day of the month). If the date isn't provided, it's the first
day of the current month. Dates can't be before the previous twelve months,
or in the future.

Output from Acceptance Testing

$ make testacc TESTS=TestAccXXX PKG=ec2

...

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/ce Issues and PRs that pertain to the ce service. labels Mar 31, 2023
…te else aws takes the first day of the current month as effective start date
@huetterma huetterma force-pushed the b-aws_ce_cost_category-fixes-effective-start-closes-29044 branch from 85ae456 to 6be41f4 Compare March 31, 2023 07:21
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @porqueoutai 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 31, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccCECostCategory_' PKG=ce ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 3  -run=TestAccCECostCategory_ -timeout 180m
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_effectiveStart
=== PAUSE TestAccCECostCategory_effectiveStart
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_tags
=== PAUSE TestAccCECostCategory_tags
=== CONT  TestAccCECostCategory_basic
=== CONT  TestAccCECostCategory_complete
=== CONT  TestAccCECostCategory_disappears
--- PASS: TestAccCECostCategory_disappears (15.10s)
=== CONT  TestAccCECostCategory_effectiveStart
--- PASS: TestAccCECostCategory_basic (21.51s)
=== CONT  TestAccCECostCategory_tags
--- PASS: TestAccCECostCategory_complete (32.10s)
=== CONT  TestAccCECostCategory_splitCharge
--- PASS: TestAccCECostCategory_effectiveStart (28.89s)
--- PASS: TestAccCECostCategory_tags (38.01s)
--- PASS: TestAccCECostCategory_splitCharge (29.67s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ce	67.462s

@ewbankkit
Copy link
Contributor

@porqueoutai Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 935f9d4 into hashicorp:main Mar 31, 2023
@github-actions github-actions bot added this to the v4.62.0 milestone Mar 31, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

This functionality has been released in v4.62.0 of the Terraform AWS 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!

@github-actions
Copy link

github-actions bot commented May 8, 2023

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 issues.
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 May 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ce Issues and PRs that pertain to the ce service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: effective_start on aws_ce_cost_category only applied if no other changes
2 participants