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

WORKING: f-aws-computeoptimizer-recommendation-preferences new resource #35349

Conversation

hunttom
Copy link
Contributor

@hunttom hunttom commented Jan 17, 2024

Description

Creates new AWS Compute Optimizer Resource to put recommendation preferences.

Relations

Closes #23945.

References

  • AWS Compute Optimizer Recommendations API: docs
  • AWS Compute Optimizer Recommendations Go V2: docs

Output from Acceptance Testing

CURRENTLY WORKING - OPEN QUESTIONS BEFORE TESTS CAN BE PUSHED.

% make testacc TESTS=TestAccXXX PKG=ec2

...

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/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/computeoptimizer Issues and PRs that pertain to the computeoptimizer service. labels Jan 17, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 17, 2024
@hunttom
Copy link
Contributor Author

hunttom commented Jan 17, 2024

@ewbankkit - (Or anyone else who might know) I have a few questions about validation logic within this specific resource. All questions are marked with a // TODO

Questions are thus:

  • Confirm validation types using ValidateDiagFunc: enum.Validate[types.<VARIOUS>](),
  • Identify Validation logic for:
    • external_metrics_preference: Requires that resource_type is set to EC2Instance How would I do that?
  • What ID should I set for this resource since no ARN is created? I was thinking of AWS Account but want to get the official stance? (resource_type is needed for create. resource_type and recommendation_preference_name is needed for delete)
  • Line Validate types required.

Thanks for your help

@justinretzolk justinretzolk added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 17, 2024
@hunttom hunttom force-pushed the f-aws_computeoptimizer_recommendation_preferences-new-resource branch from cfaba73 to cc325f7 Compare April 1, 2024 16:36
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@ewbankkit ewbankkit assigned ewbankkit and unassigned ewbankkit Sep 6, 2024
@github-actions github-actions bot added generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Sep 6, 2024
% make testacc TESTARGS='-run=TestAccComputeOptimizerEnrollmentStatus_serial' PKG=computeoptimizer
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/computeoptimizer/... -v -count 1 -parallel 20  -run=TestAccComputeOptimizerEnrollmentStatus_serial -timeout 360m
=== RUN   TestAccComputeOptimizerEnrollmentStatus_serial
=== PAUSE TestAccComputeOptimizerEnrollmentStatus_serial
=== CONT  TestAccComputeOptimizerEnrollmentStatus_serial
=== RUN   TestAccComputeOptimizerEnrollmentStatus_serial/basic
--- PASS: TestAccComputeOptimizerEnrollmentStatus_serial (21.13s)
    --- PASS: TestAccComputeOptimizerEnrollmentStatus_serial/basic (21.13s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/computeoptimizer	26.189s
% make testacc TESTARGS='-run=TestAccComputeOptimizerEnrollmentStatus_serial/includeMemberAccounts' PKG=computeoptimizer
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/computeoptimizer/... -v -count 1 -parallel 20  -run=TestAccComputeOptimizerEnrollmentStatus_serial/includeMemberAccounts -timeout 360m
=== RUN   TestAccComputeOptimizerEnrollmentStatus_serial
=== PAUSE TestAccComputeOptimizerEnrollmentStatus_serial
=== CONT  TestAccComputeOptimizerEnrollmentStatus_serial
=== RUN   TestAccComputeOptimizerEnrollmentStatus_serial/includeMemberAccounts
--- PASS: TestAccComputeOptimizerEnrollmentStatus_serial (20.80s)
    --- PASS: TestAccComputeOptimizerEnrollmentStatus_serial/includeMemberAccounts (20.80s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/computeoptimizer	25.705s
@ewbankkit ewbankkit requested a review from a team as a code owner September 10, 2024 19:00
@ewbankkit ewbankkit self-assigned this Sep 10, 2024
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=TestAccComputeOptimizer_serial/RecommendationPreferences' PKG=computeoptimizer 
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/computeoptimizer/... -v -count 1 -parallel 20  -run=TestAccComputeOptimizer_serial/RecommendationPreferences -timeout 360m
=== RUN   TestAccComputeOptimizer_serial
=== PAUSE TestAccComputeOptimizer_serial
=== CONT  TestAccComputeOptimizer_serial
=== RUN   TestAccComputeOptimizer_serial/RecommendationPreferences
=== RUN   TestAccComputeOptimizer_serial/RecommendationPreferences/basic
=== RUN   TestAccComputeOptimizer_serial/RecommendationPreferences/disappears
=== RUN   TestAccComputeOptimizer_serial/RecommendationPreferences/preferredResources
=== RUN   TestAccComputeOptimizer_serial/RecommendationPreferences/utilizationPreferences
--- PASS: TestAccComputeOptimizer_serial (61.75s)
    --- PASS: TestAccComputeOptimizer_serial/RecommendationPreferences (61.75s)
        --- PASS: TestAccComputeOptimizer_serial/RecommendationPreferences/basic (14.40s)
        --- PASS: TestAccComputeOptimizer_serial/RecommendationPreferences/disappears (11.26s)
        --- PASS: TestAccComputeOptimizer_serial/RecommendationPreferences/preferredResources (13.80s)
        --- PASS: TestAccComputeOptimizer_serial/RecommendationPreferences/utilizationPreferences (22.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/computeoptimizer	66.557s
% make testacc TESTARGS='-run=TestAccComputeOptimizer_serial/EnrollmentStatus' PKG=computeoptimizer
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.0 test ./internal/service/computeoptimizer/... -v -count 1 -parallel 20  -run=TestAccComputeOptimizer_serial/EnrollmentStatus -timeout 360m
=== RUN   TestAccComputeOptimizer_serial
=== PAUSE TestAccComputeOptimizer_serial
=== CONT  TestAccComputeOptimizer_serial
=== RUN   TestAccComputeOptimizer_serial/EnrollmentStatus
=== RUN   TestAccComputeOptimizer_serial/EnrollmentStatus/includeMemberAccounts
    enrollment_status_test.go:71: this AWS account must be the management account of an AWS Organization
=== RUN   TestAccComputeOptimizer_serial/EnrollmentStatus/basic
--- PASS: TestAccComputeOptimizer_serial (26.51s)
    --- PASS: TestAccComputeOptimizer_serial/EnrollmentStatus (26.51s)
        --- SKIP: TestAccComputeOptimizer_serial/EnrollmentStatus/includeMemberAccounts (0.73s)
        --- PASS: TestAccComputeOptimizer_serial/EnrollmentStatus/basic (25.79s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/computeoptimizer	31.328s

@ewbankkit
Copy link
Contributor

@hunttom Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit b98d7ca into hashicorp:main Sep 10, 2024
41 checks passed
@github-actions github-actions bot added this to the v5.67.0 milestone Sep 10, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 13, 2024
Copy link

This functionality has been released in v5.67.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. new-resource Introduces a new resource. service/computeoptimizer Issues and PRs that pertain to the computeoptimizer 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.

Add resources for ComputeOptimizer Recommendation Preferences
4 participants