Skip to main content
Security groups act as virtual firewalls, controlling inbound and outbound traffic for compute instances. Aliases: securitygroups, sg

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

FlagDescription
—org stringOrganization ID
—project stringProject ID
—network stringNetwork ID
—region stringRegion ID
—jsonEmit the full JSON payload (mutually exclusive with -q)
-q, —query stringArrayjq filter for value extraction (see Query output with -q)

Example


get

Get details for a specific security group.

Flags

FlagDescription
—id stringSecurity group ID
—org stringOrganization ID
—jsonEmit the full JSON payload (mutually exclusive with -q)
-q, —query stringArrayjq filter for value extraction (see Query output with -q)

create

Create a new security group. Accepts input from a JSON file or stdin.

Flags

FlagDescription
—org stringOrganization ID
-f, —file stringPath to a JSON file
—stdinRead JSON from standard input
—dry-runPreview the request payload without persisting
-y, —yesAutomatically confirm creation
—jsonEmit the full JSON payload (mutually exclusive with -q)
-q, —query stringArrayjq filter for value extraction (see Query output with -q)

Examples


update

Update an existing security group.

Flags

FlagDescription
—id stringSecurity group ID
—org stringOrganization ID
-f, —file stringPath to a JSON file
—stdinRead JSON from standard input
—dry-runPreview the request payload without persisting
-y, —yesAutomatically confirm update
—jsonEmit the full JSON payload (mutually exclusive with -q)
-q, —query stringArrayjq filter for value extraction (see Query output with -q)

Examples


delete

Delete an existing security group.

Flags


Instances (Console)

Security groups are configured during instance creation.