Skip to content

apigee: add data source google_apigee_instance#16956

Closed
xuchenma wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
xuchenma:480979983
Closed

apigee: add data source google_apigee_instance#16956
xuchenma wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
xuchenma:480979983

Conversation

@xuchenma

@xuchenma xuchenma commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new google_apigee_instance data source, allowing users to look up an existing Apigee instance by org_id and name and retrieve its metadata (host, port, service_attachment, consumer_accept_list, etc.).

Use case: Retrieve the service_attachment URI of an Apigee instance to configure a PSC endpoint, without needing to manage the instance as a Terraform resource.

Example:

data "google_apigee_instance" "this" {
  org_id = "organizations/my_org"
  name   = "my-instance"
}

# Use service_attachment to configure a PSC endpoint
resource "google_compute_forwarding_rule" "psc" {
  target = data.google_apigee_instance.this.service_attachment
  ...
}

Fixes: hashicorp/terraform-provider-google#25911

Tests

--- PASS: TestAccDataSourceApigeeInstance_basic (2112.16s)
PASS
ok  github.com/hashicorp/terraform-provider-google/google/services/apigee  2112.934s
`google_apigee_instance` (data source)

Add a data source for google_apigee_instance, allowing users to look
up an existing Apigee instance by org_id and name and retrieve its
metadata (host, port, service_attachment, etc.) for use in other
resources such as PSC service attachments.

Fixes: hashicorp/terraform-provider-google#25911
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 5, 2026
@github-actions github-actions Bot requested a review from roaks3 April 5, 2026 00:36
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@roaks3, 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.

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

@roaks3 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@roaks3 roaks3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You'll need to resolve some merge conflicts.

Also, did you consider generation from the resource with datasource:\ngenerate: true, or calling the resource Read?

@melinath

This comment was marked as duplicate.

1 similar comment
@melinath

Copy link
Copy Markdown
Member

We've moved over to using a registry for data sources instead of manually registering them. This means that provider_mmv1_resources no longer exists, which is what's causing the merge conflict.

You'll also need to add an init function so that the data sources are registered properly with the registry. See https://googlecloudplatform.github.io/magic-modules/develop/add-handwritten-datasource/ for an example.

@github-actions

Copy link
Copy Markdown

@xuchenma, 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.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

@xuchenma, this PR is waiting for action from you. If no action is taken, this PR will be closed in 14 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

@github-actions

Copy link
Copy Markdown

@xuchenma, this PR is waiting for action from you. If no action is taken, this PR will be closed in 2 weekdays.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

@github-actions

Copy link
Copy Markdown

@xuchenma, this PR is being closed due to inactivity.

@github-actions github-actions Bot closed this May 21, 2026
@xuchenma

xuchenma commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Obsolete — the google_apigee_instance data source was added and merged via #16230 and is present on main (data_source_apigee_instance.go). It looks up by org_id + name and exposes the full instance schema (including service_attachment), which covers this PR's use case. Leaving closed in favor of the merged #16230.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Apigee] Data source for googe_apigee_instance

4 participants