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

New resource for CE CostCategory, new datasources for CostExplore CostCategory and Tags #24402

Merged
merged 12 commits into from
Apr 27, 2022

Conversation

coderGo93
Copy link
Contributor

@coderGo93 coderGo93 commented Apr 25, 2022

  • Added a new resource, doc and tests for CE CostCategory called aws_ce_cost_category
  • Added a new datasource, doc and tests for CE CostCategory called aws_ce_cost_category
  • Added a new datasource, doc and tests for CE Tags called aws_ce_tags

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #12801.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccCE' PKG=ce                                           [12:01:06]
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20  -run=TestAccCE -timeout 180m
=== RUN   TestAccCECostCategoryDataSource_basic
=== PAUSE TestAccCECostCategoryDataSource_basic
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCETagsDataSource_basic
=== PAUSE TestAccCETagsDataSource_basic
=== RUN   TestAccCETagsDataSource_filter
=== PAUSE TestAccCETagsDataSource_filter
=== CONT  TestAccCECostCategoryDataSource_basic
=== CONT  TestAccCECostCategory_disappears
=== CONT  TestAccCECostCategory_complete
=== CONT  TestAccCETagsDataSource_basic
=== CONT  TestAccCETagsDataSource_filter
=== CONT  TestAccCECostCategory_splitCharge
=== CONT  TestAccCECostCategory_basic
--- PASS: TestAccCECostCategory_disappears (16.66s)
--- PASS: TestAccCETagsDataSource_basic (20.44s)
--- PASS: TestAccCETagsDataSource_filter (21.81s)
--- PASS: TestAccCECostCategory_basic (22.77s)
--- PASS: TestAccCECostCategoryDataSource_basic (23.08s)
--- PASS: TestAccCECostCategory_complete (34.80s)
--- PASS: TestAccCECostCategory_splitCharge (38.53s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 41.031s

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/XL Managed by automation to categorize the size of a PR. labels Apr 25, 2022
@YakDriver YakDriver added the service/ce Issues and PRs that pertain to the ce service. label Apr 26, 2022
@YakDriver
Copy link
Member

YakDriver commented Apr 26, 2022

@coderGo93 Thank you for your work on this Edgar! We have recently updated the service client for cost explorer to use ce to align with the naming guide. This PR will need some refactoring. We apologize for the inconvenience!

This will affect several things:

  • internal/service/ce/
  • aws_ce_...
  • website/docs/**/ce_...
  • CEConn
  • TestAccCE...

Let us know if you have questions!

@YakDriver YakDriver self-assigned this Apr 26, 2022
@coderGo93 coderGo93 changed the title New resource for CostExplorer CostCategory, new datasources for CostExplore CostCategory and Tags New resource for CE CostCategory, new datasources for CostExplore CostCategory and Tags Apr 26, 2022
@justinretzolk justinretzolk added new-resource Introduces a new resource. new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 26, 2022
@YakDriver
Copy link
Member

@coderGo93 I made some changes, so make sure to git pull before you make other changes. If you have questions about my changes, let me know.

The acceptance tests are not passing. I'm not seeing where you're setting any tags so it doesn't surprise me that the tags.# is 0. Can you take a look at it?

% make testacc TESTS=TestAccCETag PKG=ce
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCETag'  -timeout 180m
=== RUN   TestAccCETagsDataSource_basic
=== PAUSE TestAccCETagsDataSource_basic
=== RUN   TestAccCETagsDataSource_filter
=== PAUSE TestAccCETagsDataSource_filter
=== CONT  TestAccCETagsDataSource_basic
=== CONT  TestAccCETagsDataSource_filter
    tags_data_source_test.go:54: Step 1/1 error: Check failed: Check 2/2 error: data.aws_ce_tags.test: Attribute 'tags.#' expected "3", got "0"
=== CONT  TestAccCETagsDataSource_basic
    tags_data_source_test.go:26: Step 1/1 error: Check failed: Check 2/2 error: data.aws_ce_tags.test: Attribute 'tags.#' expected "4", got "0"
--- FAIL: TestAccCETagsDataSource_filter (5.93s)
--- FAIL: TestAccCETagsDataSource_basic (6.87s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/ce	8.170s

@YakDriver YakDriver added the waiting-response Maintainers are waiting on response from community or contributor. label Apr 27, 2022
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

@coderGo93 Excellent work especially given a tricky API!

Note to future readers: aws_ce_cost_category could be called aws_ce_cost_category_definition based on the API operation names. But, I agree with @coderGo93 that aws_ce_cost_category is right - it aligns better with the operation descriptions and it's more concise.

% make testacc TESTS=Test PKG=ce
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20 -run='Test'  -timeout 180m
=== RUN   TestAccCECostCategoryDataSource_basic
=== PAUSE TestAccCECostCategoryDataSource_basic
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCETagsDataSource_basic
=== PAUSE TestAccCETagsDataSource_basic
=== RUN   TestAccCETagsDataSource_filter
=== PAUSE TestAccCETagsDataSource_filter
=== CONT  TestAccCECostCategoryDataSource_basic
=== CONT  TestAccCECostCategory_disappears
=== CONT  TestAccCETagsDataSource_filter
=== CONT  TestAccCETagsDataSource_basic
=== CONT  TestAccCECostCategory_complete
=== CONT  TestAccCECostCategory_splitCharge
=== CONT  TestAccCECostCategory_basic
--- PASS: TestAccCECostCategory_disappears (8.33s)
--- PASS: TestAccCETagsDataSource_filter (10.07s)
--- PASS: TestAccCETagsDataSource_basic (11.76s)
--- PASS: TestAccCECostCategoryDataSource_basic (12.67s)
--- PASS: TestAccCECostCategory_basic (15.42s)
--- PASS: TestAccCECostCategory_complete (19.39s)
--- PASS: TestAccCECostCategory_splitCharge (23.09s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ce	24.283s

@YakDriver YakDriver merged commit 3feab8f into hashicorp:main Apr 27, 2022
@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 27, 2022
@github-actions github-actions bot added this to the v4.12.0 milestone Apr 27, 2022
@github-actions
Copy link

This functionality has been released in v4.12.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

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 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-data-source Introduces a new data source. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/ce Issues and PRs that pertain to the ce service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for AWS Cost Categories
3 participants