securitygroups, sg
Commands that act on one security group take its ID either as a positional argument or with --id. If you omit it, the CLI opens an interactive picker, so always pass it in scripts.
Subcommands
- list — List security groups
- get — Get security group details
- create — Create a new security group
- update — Update an existing security group
- delete — Delete a security group
list
List security groups, optionally filtered by organization, project, network, or region.Flags
| Flag | Description |
|---|---|
| Organization ID | |
| Project ID | |
| Network ID | |
| Region ID | |
Emit the full JSON payload (mutually exclusive with -q) | |
jq filter for value extraction (see Query output with -q) |
Example
get
Get details for a specific security group.Flags
| Flag | Description |
|---|---|
| Security group ID | |
| Organization ID | |
Emit the full JSON payload (mutually exclusive with -q) | |
jq filter for value extraction (see Query output with -q) |
create
Create a new security group. Accepts input from a JSON file or stdin; with neither, the CLI prompts for the security group details and rules.Flags
| Flag | Description |
|---|---|
| Organization ID | |
| Path to a JSON file | |
| Read JSON from standard input | |
| Preview actions and payload without persisting | |
| Automatically confirm creation | |
Emit the full JSON payload (mutually exclusive with -q) | |
jq filter for value extraction (see Query output with -q) |
Examples
update
Update an existing security group. Accepts input from a JSON file or stdin; with neither, the CLI prompts for each field, pre-filled from the security group as it stands.Flags
| Flag | Description |
|---|---|
| Security group ID | |
| Organization ID | |
| Path to a JSON file | |
| Read JSON from standard input | |
| Preview actions and payload without persisting | |
| Automatically confirm update | |
Emit the full JSON payload (mutually exclusive with -q) | |
jq filter for value extraction (see Query output with -q) |
Examples
delete
Delete an existing security group.Flags
Example
Related
Instances (Console)
Security groups are configured during instance creation.
Load balancers (CLI)
Load balancers expose services on a network; restrict listener sources with allowed CIDRs.