feat(apihub): Add support for API Hub Attributes
Fixes https://github.com/hashicorp/terraform-provider-google/issues/24372
- Add google_apihub_attribute resource
- Add pre_create hook to stop creation for system-defined attributes earlier
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.
`google_apihub_attribute`
Hello! I am a robot. Tests will require approval from a repository maintainer to run.
Googlers: For automatic test runs see go/terraform-auto-test-runs.
@NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.
You can help make sure that review is quick by doing a self-review and by running impacted tests locally.
@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.
@GoogleCloudPlatform/terraform-team @NickElliot This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.
@jayce-jia, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days.
Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

This notification can be disabled with the disable-automatic-closure label.
is there a reason you couldnt include creating an apihub instance in the tests?
Hi @NickElliot sorry somehow missed the message. TBH I didn't dig deep into how the hub instance should be created for tests.
Just referred to all other resources (example), tests were all excluded. I supposed there was a reason and the apihub team should be resolving this.
I'm not very familiar with the testing infra of this project. But happy to explore that if you have an example.
@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.
No worries Nick, yes I've done tests on my local and CRUD for resources are good. I'm using this forked version to provision attributes for my projects now and no further issues.
@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.
@NickElliot This PR is approved and has been waiting for merge for 1 week. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.
@NickElliot This PR is approved and has been waiting for merge for 2 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.
@NickElliot This PR is approved and has been waiting for merge for 3 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.
@NickElliot This PR is approved and has been waiting for merge for 4 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.
@NickElliot This PR is approved and has been waiting for merge for 5 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.
@NickElliot This PR is approved and has been waiting for merge for 6 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.
/gcbrun
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
google provider: Diff ( 5 files changed, 1265 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 1265 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 233 insertions(+))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_apihub_attribute (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_apihub_attribute" "primary" {
allowed_values {
description = # value needed
display_name = # value needed
id = # value needed
immutable = # value needed
}
attribute_id = # value needed
cardinality = # value needed
data_type = # value needed
description = # value needed
display_name = # value needed
location = # value needed
scope = # value needed
}
Tests analytics
Total tests: 2 Passed tests: 1 Skipped tests: 1 Affected tests: 0
Click here to see the affected service packages
- apihub
🟢 All tests passed!
View the build log