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 aws_bedrock_inference_profile #40294

Merged
merged 8 commits into from
Dec 4, 2024

Conversation

chlunde
Copy link
Contributor

@chlunde chlunde commented Nov 25, 2024

Description

Introduce new resource aws_bedrock_inference_profile, which allows cost tracking and metrics.

Relations

Closes #40288

References

Output from Acceptance Testing

make testacc TESTS=TestAccBedrockInferenceProfile_.* PKG=bedrock
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/bedrock/... -v -count 1 -parallel 20 -run='TestAccBedrockInferenceProfile_.*'  -timeout 360m
2024/11/26 13:08:22 Initializing Terraform AWS Provider...
=== RUN   TestAccBedrockInferenceProfile_basic
=== PAUSE TestAccBedrockInferenceProfile_basic
=== RUN   TestAccBedrockInferenceProfile_tags
=== PAUSE TestAccBedrockInferenceProfile_tags
=== RUN   TestAccBedrockInferenceProfile_disappears
=== PAUSE TestAccBedrockInferenceProfile_disappears
=== CONT  TestAccBedrockInferenceProfile_basic
=== CONT  TestAccBedrockInferenceProfile_disappears
=== CONT  TestAccBedrockInferenceProfile_tags
--- PASS: TestAccBedrockInferenceProfile_disappears (31.94s)
--- PASS: TestAccBedrockInferenceProfile_basic (37.83s)
--- PASS: TestAccBedrockInferenceProfile_tags (46.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrock	46.205s

@chlunde chlunde requested a review from a team as a code owner November 25, 2024 15:37
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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/bedrock Issues and PRs that pertain to the bedrock service. needs-triage Waiting for first response or review from a maintainer. labels Nov 25, 2024
@chlunde chlunde force-pushed the f-bedrock-inference-profile branch 2 times, most recently from ec9163b to 85a9f83 Compare November 25, 2024 20:02
Copy link
Contributor

@gdavison gdavison 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 the PR, @chlunde!

The PR #40305 will add tagging tests for bedrock resources.

It is ok to share code between the resource and data source in some cases. The schemas should be separate, but other code can be shared

internal/service/bedrock/inference_profile.go Outdated Show resolved Hide resolved
internal/service/bedrock/inference_profile.go Outdated Show resolved Hide resolved
@chlunde chlunde force-pushed the f-bedrock-inference-profile branch from 85a9f83 to f0398c3 Compare November 26, 2024 12:07
@chlunde chlunde requested a review from gdavison November 26, 2024 12:17
@gdavison gdavison force-pushed the f-bedrock-inference-profile branch from f0398c3 to 459a740 Compare December 4, 2024 20:56
Copy link
Contributor

@gdavison gdavison 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 the PR, @chlunde. I've made a few changes:

  • Removed optional attributes from the basic test
  • Added a separate test for description
  • Generated tagging tests

@ewbankkit ewbankkit added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 4, 2024
@ewbankkit ewbankkit self-assigned this Dec 4, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 4, 2024
ewbankkit
ewbankkit previously approved these changes Dec 4, 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=TestAccBedrockInferenceProfile_' PKG=bedrock
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/bedrock/... -v -count 1 -parallel 20  -run=TestAccBedrockInferenceProfile_ -timeout 360m
2024/12/04 16:10:34 Initializing Terraform AWS Provider...
=== RUN   TestAccBedrockInferenceProfile_tags
=== PAUSE TestAccBedrockInferenceProfile_tags
=== RUN   TestAccBedrockInferenceProfile_tags_null
=== PAUSE TestAccBedrockInferenceProfile_tags_null
=== RUN   TestAccBedrockInferenceProfile_tags_EmptyMap
=== PAUSE TestAccBedrockInferenceProfile_tags_EmptyMap
=== RUN   TestAccBedrockInferenceProfile_tags_AddOnUpdate
=== PAUSE TestAccBedrockInferenceProfile_tags_AddOnUpdate
=== RUN   TestAccBedrockInferenceProfile_tags_EmptyTag_OnCreate
=== PAUSE TestAccBedrockInferenceProfile_tags_EmptyTag_OnCreate
=== RUN   TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Add
=== PAUSE TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Add
=== RUN   TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Replace
=== PAUSE TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Replace
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_providerOnly
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_providerOnly
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_nonOverlapping
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_nonOverlapping
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_overlapping
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_overlapping
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_updateToProviderOnly
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_updateToProviderOnly
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_updateToResourceOnly
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_updateToResourceOnly
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_emptyResourceTag
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_emptyResourceTag
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_emptyProviderOnlyTag
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_emptyProviderOnlyTag
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_nullOverlappingResourceTag
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_nullOverlappingResourceTag
=== RUN   TestAccBedrockInferenceProfile_tags_DefaultTags_nullNonOverlappingResourceTag
=== PAUSE TestAccBedrockInferenceProfile_tags_DefaultTags_nullNonOverlappingResourceTag
=== RUN   TestAccBedrockInferenceProfile_tags_ComputedTag_OnCreate
=== PAUSE TestAccBedrockInferenceProfile_tags_ComputedTag_OnCreate
=== RUN   TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Add
=== PAUSE TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Add
=== RUN   TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Replace
=== PAUSE TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Replace
=== RUN   TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_DefaultTag
=== PAUSE TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_DefaultTag
=== RUN   TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_ResourceTag
=== PAUSE TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_ResourceTag
=== RUN   TestAccBedrockInferenceProfile_basic
=== PAUSE TestAccBedrockInferenceProfile_basic
=== RUN   TestAccBedrockInferenceProfile_disappears
=== PAUSE TestAccBedrockInferenceProfile_disappears
=== RUN   TestAccBedrockInferenceProfile_description
=== PAUSE TestAccBedrockInferenceProfile_description
=== CONT  TestAccBedrockInferenceProfile_tags
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_emptyResourceTag
=== CONT  TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_DefaultTag
=== CONT  TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Replace
=== CONT  TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Replace
=== CONT  TestAccBedrockInferenceProfile_disappears
=== CONT  TestAccBedrockInferenceProfile_basic
=== CONT  TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_ResourceTag
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_updateToResourceOnly
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_updateToProviderOnly
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_overlapping
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_nonOverlapping
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_providerOnly
=== CONT  TestAccBedrockInferenceProfile_tags_AddOnUpdate
=== CONT  TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Add
=== CONT  TestAccBedrockInferenceProfile_tags_EmptyTag_OnCreate
=== CONT  TestAccBedrockInferenceProfile_tags_EmptyMap
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_nullNonOverlappingResourceTag
=== CONT  TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Add
=== CONT  TestAccBedrockInferenceProfile_description
--- PASS: TestAccBedrockInferenceProfile_disappears (17.30s)
=== CONT  TestAccBedrockInferenceProfile_tags_ComputedTag_OnCreate
--- PASS: TestAccBedrockInferenceProfile_basic (18.21s)
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_emptyResourceTag (28.82s)
=== CONT  TestAccBedrockInferenceProfile_tags_null
--- PASS: TestAccBedrockInferenceProfile_tags_EmptyMap (29.09s)
=== CONT  TestAccBedrockInferenceProfile_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_updateToProviderOnly (37.67s)
--- PASS: TestAccBedrockInferenceProfile_description (38.60s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_nullNonOverlappingResourceTag (40.62s)
--- PASS: TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Add (42.33s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_nullOverlappingResourceTag (25.36s)
--- PASS: TestAccBedrockInferenceProfile_tags_ComputedTag_OnCreate (27.50s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_updateToResourceOnly (45.85s)
--- PASS: TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Replace (45.87s)
--- PASS: TestAccBedrockInferenceProfile_tags_AddOnUpdate (48.84s)
--- PASS: TestAccBedrockInferenceProfile_tags_null (21.52s)
--- PASS: TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_DefaultTag (50.44s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_emptyProviderOnlyTag (21.51s)
--- PASS: TestAccBedrockInferenceProfile_tags_ComputedTag_OnUpdate_Replace (51.65s)
--- PASS: TestAccBedrockInferenceProfile_tags_IgnoreTags_Overlap_ResourceTag (52.98s)
--- PASS: TestAccBedrockInferenceProfile_tags_EmptyTag_OnUpdate_Add (54.21s)
--- PASS: TestAccBedrockInferenceProfile_tags_EmptyTag_OnCreate (54.21s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_overlapping (65.09s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_nonOverlapping (65.14s)
--- PASS: TestAccBedrockInferenceProfile_tags_DefaultTags_providerOnly (72.11s)
--- PASS: TestAccBedrockInferenceProfile_tags (76.43s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/bedrock	82.058s

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 🚀.

@gdavison gdavison merged commit 2752139 into hashicorp:main Dec 4, 2024
43 checks passed
@github-actions github-actions bot added this to the v5.81.0 milestone Dec 4, 2024
@chlunde chlunde deleted the f-bedrock-inference-profile branch December 5, 2024 20:19
@chlunde
Copy link
Contributor Author

chlunde commented Dec 5, 2024

@gdavison @ewbankkit thanks!

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 12, 2024
Copy link

This functionality has been released in v5.81.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/bedrock Issues and PRs that pertain to the bedrock service. 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.

[New Resource]: "aws_bedrock_inference_profile" - Cost allocation and metrics for bedrock
3 participants