ip-profile
ip-profile assign
Restrict an application to a profile's networks.
writesrepeatable--dry-run
Attaches a profile to an application, so only the networks in it can reach that application.
It applies as soon as the request returns. Nothing needs deploying, which also means there is no build to wait behind if the rules are wrong.
Usage
outplane ip-profile assign <PROFILE> [flags]Arguments
| Argument | Type | Description |
|---|---|---|
PROFILE | string | Profile name or id. Required. |
Flags
| Flag | Type | Description |
|---|---|---|
--app | string | Application name or id. Defaults to the linked app. A flag rather than an argument, because the profile is the argument. |
The global flags apply as well.
Output
| Field | Type | Description |
|---|---|---|
action | string | One of assign, unassign. |
profile | string | |
profileId | string | |
app | string | |
appId | string | |
rules | int | How many networks the application will answer. |
changed | bool | False for a dry run, and false when it was already attached. |
Examples
See what it would restrict, without restricting it
outplane ip-profile assign office --app checkout --dry-run --json{
"action": "assign",
"app": "checkout",
"changed": false,
"profile": "office",
"rules": 2
}Restrict an application
outplane ip-profile assign office --app checkoutRead the result in a pipeline
outplane ip-profile assign office --app checkout --json --fields app,rules,changedWhat to Know
- Applies immediately. Unlike an environment variable or a port, this does not wait for a deployment: the application stops answering other addresses as soon as the request returns.
- Idempotent. Attaching something already attached reports changed false and exits 0.
- A profile with no rules makes the application reachable from nowhere. The request is not refused, and the result reports rules 0.
- More than one profile can be attached to the same application. They add up: an address allowed by any attached profile gets through.
Errors
Beyond 0 for success, this command exits with:
| Exit | Kind | Meaning |
|---|---|---|
2 | usage | Invalid arguments, unknown flag, or client-side validation failure. |
3 | auth | Not authenticated, token revoked or expired, or forbidden for this team. |
5 | not_found | The named resource does not exist, or is not visible to this credential. |
8 | upstream | The Out Plane API returned a server error. |
The code on the error object is one of ipprofile.not_found, app.not_found, context.no_app, usage.missing_argument. Branch on that, or on the exit status. The message is prose and changes.