Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPC routing: Want CLI command to reset a system router #734

Open
1 of 4 tasks
FelixMcFelix opened this issue Jul 9, 2024 · 5 comments
Open
1 of 4 tasks

VPC routing: Want CLI command to reset a system router #734

FelixMcFelix opened this issue Jul 9, 2024 · 5 comments
Assignees
Labels
feature Issue for a new feature that does not break current functionality

Comments

@FelixMcFelix
Copy link
Contributor

Target component

  • CLI
  • SDK
  • Something else
  • Not sure

Overview

Since the outbound/default routes in a VPC system router have mutable targets, it's possible for a user to shut themselves off from being able to SSH into their instances. While fixing this state is easy enough (and outlined in the guide), a command to reset these routes to their factory default would save some time.

Implementation details

The system router and its routes have fixed names in a VPC. We can probably then have:

oxide vpc router restore-default [v4, v6, *both*] \
  --project oxdoc \
  --vpc subnet-guide

Anything else you would like to add?

No response

@FelixMcFelix FelixMcFelix added the feature Issue for a new feature that does not break current functionality label Jul 9, 2024
@FelixMcFelix FelixMcFelix self-assigned this Jul 9, 2024
@ahl
Copy link
Collaborator

ahl commented Jul 9, 2024

The CLI is mostly a wrapper around the API. Do we want an API that corresponds to this action? Or why would we prefer this as a custom CLI-only action?

@david-crespo
Copy link
Contributor

david-crespo commented Jul 9, 2024

In other words, what would this look like with existing commands, and can we tolerate putting that command in a doc and saying "run this"?

@ahl
Copy link
Collaborator

ahl commented Jul 9, 2024

I was thinking more "if this is useful, let's make it an API call rather than implement the logic in the CLI and console"

@david-crespo
Copy link
Contributor

Depends on how ugly the existing command is! If it takes an arbitrary number of commands because it scales with the number of routes, then definitely would like this in the API instead.

@FelixMcFelix
Copy link
Contributor Author

FelixMcFelix commented Jul 9, 2024

With existing commands, for IPv4 it looks like (in the forthcoming guide):

restore.json

{
  "destination": {"type": "ip_net", "value": "0.0.0.0/0"},
  "target": {"type": "internet_gateway", "value": "outbound"}
}
oxide vpc router route update \
  --project oxdoc \
  --vpc subnet-guide \
  --router system \
  --route default-v4 \
  --json-body restore.json

(The destination value must be updated if we also need to restore the v6 route. There are only two default routes in total in the system router, nothing else there is user-modifiable.)

I would say the original thought process here was that this requires a bit more effort on the CLI (due to --json-body) than it would via the SDK or API. I can see the value in just making it into an endpoint, however since we'd be forcing those consumers to jump through the same hoops (correct names, correct destination, knowledge that InternetGateway("outbound") is the default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issue for a new feature that does not break current functionality
Projects
None yet
Development

No branches or pull requests

3 participants