Skip to content

feat(networkservices): generate AgentConnectivityTemplate and add to … - #18456

Open
ericlin0101 wants to merge 5 commits into
GoogleCloudPlatform:mainfrom
ericlin0101:agw-act
Open

feat(networkservices): generate AgentConnectivityTemplate and add to …#18456
ericlin0101 wants to merge 5 commits into
GoogleCloudPlatform:mainfrom
ericlin0101:agw-act

Conversation

@ericlin0101

@ericlin0101 ericlin0101 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This PR introduces Terraform support for managing Network Services Agent Connectivity Templates.

Changes included:

New Resource (google_network_services_agent_connectivity_template): Created the magic module definition AgentConnectivityTemplate.yaml to generate the new resource and explicitly map public configuration options (e.g. access_types, access_path, egress_network_config), skipping internal flags.
Modified Resource (google_network_services_agent_gateway): Added the agent_connectivity_template cross-reference field.

Examples & Tests: Updated the agent_gateway_full sample to automatically configure and bind an agent_connectivity_template natively within Terraform tests to ensure E2E Egress validation.

networkservices: generated `AgentConnectivityTemplate` and added to AgentGateway

@github-actions
github-actions Bot requested a review from slevenick July 29, 2026 21:21
@github-actions

Copy link
Copy Markdown

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

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

docs:
base_url: projects/{{project}}/locations/{{location}}/agentConnectivityTemplates
self_link: projects/{{project}}/locations/{{location}}/agentConnectivityTemplates/{{name}}
create_url: projects/{{project}}/locations/{{location}}/agentConnectivityTemplates?agentConnectivityTemplateId={{name}}

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.

Prefer reflecting agentConnectivityTemplateId in the field instead of name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed

Name of the AgentConnectivityTemplate resource.
required: true
ignore_read: true
custom_expand: templates/terraform/custom_expand/network_services_agent_connectivity_template_name.go.tmpl

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.

Is this required by the API? Prefer to remove otherwise

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not required by the API payload! I went ahead and removed the custom_expand in the latest commit, substituting it with agentConnectivityTemplateId as a url_param_only parameter.

samples:
- name: network_services_agent_connectivity_template_basic
primary_resource_id: default
steps:

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.

Add an update test here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Added an update test

@modular-magician

modular-magician commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit f7093a9:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 9 files changed, 1738 insertions(+)
google-beta provider View Diff 9 files changed, 1738 insertions(+)
terraform-google-conversion View Diff 2 files changed, 307 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_network_services_agent_connectivity_template (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_network_services_agent_connectivity_template" "primary" {
  egress_network_config {
    dns_peering_config {
      domains        = # value needed
      target_network = # value needed
      target_project = # value needed
    }
    network_attachment = # value needed
    vpc_egress         = # value needed
  }
}

Missing service labels

The following new resources do not have corresponding service labels:

  • google_network_services_agent_connectivity_template

If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels.
An override-missing-service-label label can be added to allow merging.

Test report

Analytics

Total Tests Passed Skipped Affected
102 98 2 2
Affected Service Packages
  • networkservices

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccNetworkServicesAgentConnectivityTemplate_networkServicesAgentConnectivityTemplateBasicExample
  • TestAccNetworkServicesAgentGateway_networkServicesAgentGatewayFullExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccNetworkServicesAgentConnectivityTemplate_networkServicesAgentConnectivityTemplateBasicExample
❌ Error · Log - TestAccNetworkServicesAgentGateway_networkServicesAgentGatewayFullExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@ericlin0101 VCR tests complete for f7093a9!

@github-actions
github-actions Bot requested a review from slevenick July 30, 2026 01:48
@modular-magician

modular-magician commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit b1613a6:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 9 files changed, 1769 insertions(+)
google-beta provider View Diff 9 files changed, 1769 insertions(+)
terraform-google-conversion View Diff 2 files changed, 280 insertions(+)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_network_services_agent_connectivity_template (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_network_services_agent_connectivity_template" "primary" {
  egress_network_config {
    dns_peering_config {
      domains        = # value needed
      target_network = # value needed
      target_project = # value needed
    }
    network_attachment = # value needed
    vpc_egress         = # value needed
  }
}

Missing service labels

The following new resources do not have corresponding service labels:

  • google_network_services_agent_connectivity_template

If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels.
An override-missing-service-label label can be added to allow merging.

Test report

Analytics

Total Tests Passed Skipped Affected
102 98 2 2
Affected Service Packages
  • networkservices

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccNetworkServicesAgentConnectivityTemplate_networkServicesAgentConnectivityTemplateBasicExample
  • TestAccNetworkServicesAgentGateway_networkServicesAgentGatewayFullExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccNetworkServicesAgentConnectivityTemplate_networkServicesAgentConnectivityTemplateBasicExample
❌ Error · Log - TestAccNetworkServicesAgentGateway_networkServicesAgentGatewayFullExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@ericlin0101, @slevenick VCR tests complete for b1613a6!

- Removed trailing whitespace in AgentConnectivityTemplate.yaml
- Added google_network_services_agent_connectivity_template to enrolled_teams.yml
- Created network_services_agent_connectivity_template_advanced sample
- Handled dns_peering_config, network_attachment, and vpc_egress
- Added network_services_agent_connectivity_template_advanced_update.tf.tmpl to test update workflows for egress_network_config
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jul 30, 2026
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 service/networkservices-agent-gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants