Skip to main content

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​

OptionDescription
--direction, -dTraffic direction. One of: ingress (inbound), egress (outbound) (required)
--ethertype, -eIP version. One of: IPv4, IPv6
Default: IPv4
--port-range, -tPort range as min-max, e.g. 80-80 or 1-65535
--protocol, -pProtocol, e.g. tcp, udp, icmp. Omit for any protocol
--remote-group-id, -gRemote security group name or ID (use this or --remote-ip-prefix)
--remote-ip-prefix, -rRemote IP block in CIDR notation, e.g. 0.0.0.0/0 (use this or --remote-group-id)
--security-group-id, -iID of the security group to add the rule to (required)
CommandDescription
dtctl security-group listList security groups
dtctl security-group showShow a security group
dtctl security-group createCreate a security group
dtctl security-group updateUpdate a security group
dtctl security-group deleteDelete a security group
dtctl security-group delete-ruleDelete a rule
dtctl security-group my-ipShow your public IP
dtctl security-group rule-detailsShow a rule
dtctl security-group rulesList a security group's rules

Global Flags​

OptionDescription
--api-urlSend this command to a different API endpoint, e.g. a test environment (default "https://console.dt.net.tr/api/v1")
--config, -cSpecify a custom config file
Default: ~/.config/dtctl/config.yaml
--no-headersOmit the column headers, for scripting
Default: false
--output, -oOutput format: text, wide, vertical, json. text fits the terminal, wide never truncates, vertical prints one field per line
Default: text