dtctl security-group create-rule
Usage
dtctl security-group create-rule [flags]
Aliases
cr
Description
Add an inbound or outbound rule to a security group. Restrict the rule by protocol, port range, and either a remote CIDR (--remote-ip-prefix) or a remote security group (--remote-group-id).
Example
# Allow inbound TCP port 443 from anywhere
dtctl security-group create-rule --security-group-id <security-group-id> --direction ingress --protocol tcp --port-range 443-443 --remote-ip-prefix 0.0.0.0/0
Flags
| Option | Description |
|---|---|
--direction, -d | Traffic direction. One of: ingress (inbound), egress (outbound) (required) |
--ethertype, -e | IP version. One of: IPv4, IPv6 Default: IPv4 |
--port-range, -t | Port range as min-max, e.g. 80-80 or 1-65535 |
--protocol, -p | Protocol, e.g. tcp, udp, icmp. Omit for any protocol |
--remote-group-id, -g | Remote security group name or ID (use this or --remote-ip-prefix) |
--remote-ip-prefix, -r | Remote IP block in CIDR notation, e.g. 0.0.0.0/0 (use this or --remote-group-id) |
--security-group-id, -i | ID of the security group to add the rule to (required) |
Related Commands
| Command | Description |
|---|---|
| dtctl security-group list | List security groups |
| dtctl security-group show | Show a security group |
| dtctl security-group create | Create a security group |
| dtctl security-group update | Update a security group |
| dtctl security-group delete | Delete a security group |
| dtctl security-group delete-rule | Delete a rule |
| dtctl security-group my-ip | Show your public IP |
| dtctl security-group rule-details | Show a rule |
| dtctl security-group rules | List a security group's rules |
Global Flags
| Option | Description |
|---|---|
--api-url | Send this command to a different API endpoint, e.g. a test environment (default "https://console.dt.net.tr/api/v1") |
--config, -c | Specify a custom config file Default: ~/.config/dtctl/config.yaml |
--no-headers | Omit the column headers, for scripting Default: false |
--output, -o | Output format: text, wide, vertical, json. text fits the terminal, wide never truncates, vertical prints one field per line Default: text |