Skip to content

feat: add routing table and route IDs to module outputs#1143

Merged
maheshwarishikha merged 7 commits intoterraform-ibm-modules:mainfrom
manish-jangra:output-route-table-ids
Mar 23, 2026
Merged

feat: add routing table and route IDs to module outputs#1143
maheshwarishikha merged 7 commits intoterraform-ibm-modules:mainfrom
manish-jangra:output-route-table-ids

Conversation

@manish-jangra
Copy link
Copy Markdown
Contributor

@manish-jangra manish-jangra commented Feb 25, 2026

Description

The module creates VPC routing tables (ibm_is_vpc_routing_table) and routing table routes (ibm_is_vpc_routing_table_route) but does not expose their IDs or details in the module outputs. Additionally, the VPC's default routing table (automatically created with every VPC) is not surfaced either. This makes it difficult for consumers to reference routing tables in downstream resources or modules.

This PR adds three new outputs to outputs.tf:

  • default_routing_table — An object containing the routing_table_id and routing_table_name of the VPC's default routing table. Sourced from data.ibm_is_vpc so it works for both created and existing VPCs.
  • routing_table_ids — A list of objects containing the name and routing_table_id for each custom routing table created by the module.
  • routing_table_routes — A list of objects containing the name, routing_table_id, destination, action, next_hop, and zone for each routing table route.

All outputs are backward-compatible: default_routing_table is always populated, while the other two return empty lists when no custom routes are configured via the routes variable.

Release required?

  • No release
  • Patch release (x.x.X)
  • Minor release (x.X.x)
  • Major release (X.x.x)
Release notes content

Three new outputs have been added to the module:

  • default_routing_table: Exposes the ID and name of the VPC's default routing table.
  • routing_table_ids: Exposes the name and ID of each custom VPC routing table created by the module.
  • routing_table_routes: Exposes details (name, routing table ID, destination, action, next hop, zone) of each routing table route created by the module.

No breaking changes.

Run the pipeline

If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.

Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:

/run pipeline

Checklist for reviewers

  • If relevant, a test for the change is included or updated with this PR.
  • If relevant, documentation for the change is included or updated with this PR.

For mergers

  • Use a conventional commit message to set the release level. Follow the guidelines.
  • Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
  • Use the Squash and merge option.

The module creates routing tables and routes but did not expose their
IDs, making it difficult for consumers to reference them. This adds
`routing_table_ids` and `routing_table_routes` outputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@manish-jangra
Copy link
Copy Markdown
Contributor Author

@rajatagarwal-ibm @maheshwarishikha I recently came across a use case where we needed to use the route table ids to pass in to the other module. Please feel free to add comments to suggestions.

@manish-jangra
Copy link
Copy Markdown
Contributor Author

/run pipeline

@github-actions
Copy link
Copy Markdown

@manish-jangra you must be in the team github-collaborators in order to trigger the pipeline.

Expose the VPC's default routing table ID and name via a new
`default_routing_table` output, sourced from the `data.ibm_is_vpc` data
source so it works for both created and existing VPCs.

Made-with: Cursor
@maheshwarishikha
Copy link
Copy Markdown
Member

@manish-jangra Thank you for the PR.
Would you please add these outputs to DA code as well.

Propagate the three new routing table outputs (default_routing_table,
routing_table_ids, routing_table_routes) to the fully-configurable
deployable architecture solution.

Made-with: Cursor
@manish-jangra
Copy link
Copy Markdown
Contributor Author

manish-jangra commented Mar 5, 2026

@manish-jangra Thank you for the PR. Would you please add these outputs to DA code as well.

@maheshwarishikha those outputs have been added to DA code, thanks

@maheshwarishikha
Copy link
Copy Markdown
Member

/run pipeline

Run terraform-docs to update the Outputs tables in the root module and
fully-configurable DA solution README files.

Made-with: Cursor
@manish-jangra
Copy link
Copy Markdown
Contributor Author

@maheshwarishikha It looks I forgot to update the README file and that caused CI to fail. This probbaly needs another approval and /run pipeline trigger from you.

@manish-jangra
Copy link
Copy Markdown
Contributor Author

/run pipeline

@github-actions
Copy link
Copy Markdown

@manish-jangra you must be in the team github-collaborators in order to trigger the pipeline.

@manish-jangra
Copy link
Copy Markdown
Contributor Author

@rajatagarwal-ibm @maheshwarishikha sorry to ping you both, can we make this change through?

@manish-jangra
Copy link
Copy Markdown
Contributor Author

@rajatagarwal-ibm @maheshwarishikha sorry to ping you both, can we make this change through?

@rajatagarwal-ibm @maheshwarishikha Just wanted to check, if you happened to look at this pull request.

@maheshwarishikha maheshwarishikha removed the request for review from rajatagarwal-ibm March 19, 2026 13:16
@maheshwarishikha
Copy link
Copy Markdown
Member

/run pipeline

@maheshwarishikha
Copy link
Copy Markdown
Member

Addon test failed during undeploy -

[TestVpcAddonDefaultConfiguration] Errors occurred during undeploy
[TestVpcAddonDefaultConfiguration]   (deploy-arch-ibm-apprapp-fiitvr) failed Undeployment
Schematics job logs for member: deploy-arch-ibm-apprapp-fiitvr, Schematics Workspace CRN: crn:v1:bluemix:public:schematics:us-south:a/abac0df06b644a9cabc6e44f55b3880e:678a3495-26a0-49cd-b858-2305016e1400:workspace:us-east.workspace.projects-service.891e56dc
	(deploy-arch-ibm-apprapp-fiitvr) failed Undeployment, Schematics Undeploy Job ID: .ACTIVITY.b6830f40
Schematics workspace URL: https://cloud.ibm.com/schematics/workspaces/us-east.workspace.projects-service.891e56dc/jobs?region=us
Schematics Job URL: https://cloud.ibm.com/schematics/workspaces/us-east.workspace.projects-service.891e56dc/log/.ACTIVITY.b6830f40
	(deploy-arch-ibm-apprapp-fiitvr) Undeployment result: failed
	(deploy-arch-ibm-apprapp-fiitvr) Failed resource: ibm_app_config_integration_en.app_config_integration_en[0]
	(deploy-arch-ibm-apprapp-fiitvr) Undeployment error:
Error: ge: [ERROR] Error deleting trusted profile policy: Policy with Id fe3120f1-9c48-4b5a-a094-f1c9d3a428c2 not found.
		resource_type: ibm_app_config_integration_en.app_config_integration_en[0]

Rerunning...

@maheshwarishikha
Copy link
Copy Markdown
Member

/run pipeline

@maheshwarishikha
Copy link
Copy Markdown
Member

Add on test is failed this time - because of vpn gateway. It was passed in last run. unrelated to this PR.
Rerunning...

@maheshwarishikha
Copy link
Copy Markdown
Member

/run pipeline

@maheshwarishikha
Copy link
Copy Markdown
Member

@manish-jangra I fixed the docs in your PR, now its ready to merge.

Please do note that you just need to run pre-commit, it automatically takes care of the docs update. And you do not need to add any additional tags in readme.
Thank you.

@maheshwarishikha maheshwarishikha merged commit 264baf7 into terraform-ibm-modules:main Mar 23, 2026
2 checks passed
@terraform-ibm-modules-ops
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 8.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants