Skip to content

Add nexthop parameter to cloudstack_static_route resource#284

Open
bhouse-nexthop wants to merge 1 commit intoapache:mainfrom
bhouse-nexthop:feature/static-route-nexthop
Open

Add nexthop parameter to cloudstack_static_route resource#284
bhouse-nexthop wants to merge 1 commit intoapache:mainfrom
bhouse-nexthop:feature/static-route-nexthop

Conversation

@bhouse-nexthop
Copy link

This change adds support for the nexthop parameter in static routes, which allows VPC-based routing without requiring a private gateway id.

Resource Changes:

  • Add nexthop and vpc_id optional parameters to schema
  • nexthop is mutually exclusive with gateway_id
  • When using nexthop, vpc_id is required
  • When using gateway_id, nexthop and vpc_id are not allowed
  • Update resource creation logic to support both routing methods:
    • Private Gateway routing (gateway_id)
    • VPC direct routing (nexthop + vpc_id)
  • Update Read function to maintain plan stability for both modes

Test Coverage:

  • Add comprehensive test coverage for both routing methods
  • Add testAccPreCheckStaticRouteNexthop helper to check CloudStack version
  • Automatically skip nexthop tests on CloudStack versions < 4.22.0
  • Version check uses CloudStack capabilities API
  • Tests are skipped (not failed) on older versions for backward compatibility
  • All acceptance tests passing (2/2)

Documentation:

  • Update documentation with examples for both routing methods
  • Document mutual exclusivity requirements
  • Note CloudStack 4.22+ requirement for nexthop support

CI/CD:

  • Add CloudStack 4.22.0.0 to acceptance test matrix
  • Ensures tests run on both old and new CloudStack versions

This change adds support for the nexthop parameter in static routes,
which allows VPC-based routing without requiring a private gateway.

Resource Changes:
- Add nexthop and vpc_id optional parameters to schema
- nexthop is mutually exclusive with gateway_id
- When using nexthop, vpc_id is required
- When using gateway_id, nexthop and vpc_id are not allowed
- Update resource creation logic to support both routing methods:
  - Private Gateway routing (gateway_id)
  - VPC direct routing (nexthop + vpc_id)
- Update Read function to maintain plan stability for both modes

Test Coverage:
- Add comprehensive test coverage for both routing methods
- Add testAccPreCheckStaticRouteNexthop helper to check CloudStack version
- Automatically skip nexthop tests on CloudStack versions < 4.22.0
- Version check uses CloudStack capabilities API
- Tests are skipped (not failed) on older versions for backward compatibility
- All acceptance tests passing (2/2)

Documentation:
- Update documentation with examples for both routing methods
- Document mutual exclusivity requirements
- Note CloudStack 4.22+ requirement for nexthop support

CI/CD:
- Add CloudStack 4.22.0.0 to acceptance test matrix
- Ensures tests run on both old and new CloudStack versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant