EC2-REVOKE(1)
okay so bestie, sit down, hydrate, because this is EC2-REVOKE, and it lives in the User Commands manual β that's section 1 if you're keeping score π
. It's the little command that takes permissions away from a security group, and honestly? Sometimes you gotta be the one who says "no <3" to a port. Let's get into it.
πΈ NAME πΈ
ec2-revoke β revoke permissions from a group π«π
β¨ SYNOPSIS β¨
ec2revoke ([ec2-revoke])
ec2revoke [GENERAL OPTIONS] GROUP [SPECIFIC OPTIONS]
π GENERAL NOTES π
Any command option/parameter may be passed a value of - to indicate that values for that option should be read from stdin. So like, if you don't wanna type your secret in the shell where everyone can see it, you can pipe it in instead. Very demure, very mindful π
π¦ DESCRIPTION π¦
Revoke selected permissions from a specified group. That's the whole vibe β you point at a group, you point at a rule, and the rule is gone.
The GROUP parameter is name or ID of the group to revoke this permission from.
β οΈ heads up bestie: VPC security groups for non-default VPCs must be specified by ID. Not name. ID. The name will not save you here, I promise. π
π GENERAL OPTIONS π
-O,--aws-access-key KEYβ Your AWS Access Key ID. Defaults to the value of theAWS_ACCESS_KEYenvironment variable (if set).-W,--aws-secret-key KEYβ Your AWS Secret Access Key. Defaults to the value of theAWS_SECRET_KEYenvironment variable (if set). π€«-T,--security-token TOKENβ AWS delegation token. Defaults to the value of theAWS_DELEGATION_TOKENenvironment variable (if set).-K,--private-key KEYβ [DEPRECATED] SpecifyKEYas the private key to use. Defaults to the value of theEC2_PRIVATE_KEYenvironment variable (if set). Overrides the default. (it's giving legacy, ngl π)-C,--cert CERTβ [DEPRECATED] SpecifyCERTas the X509 certificate to use. Defaults to the value of theEC2_CERTenvironment variable (if set). Overrides the default.-U,--url URLβ SpecifyURLas the web service URL to use. Defaults to the value ofhttps://ec2.amazonaws.com(us-east-1) or to that of theEC2_URLenvironment variable (if set). Overrides the default.--region REGIONβ SpecifyREGIONas the web service region to use. This option will override the URL specified by the-U URLoption andEC2_URLenvironment variable. This option defaults to the region specified by theEC2_URLenvironment variable orus-east-1if this environment variable is not set.-D,--auth-dry-runβ Check if you can perform the requested action rather than actually performing it. A little "can I?" moment before you commit. Iconic.-v,--verboseβ Verbose output. Give me all the lore.-?,--helpβ Display this help.-H,--headersβ Display column headers.--debugβ Display additional debugging information.--show-empty-fieldsβ Indicate empty fields.--hide-tagsβ Do not display tags for tagged resources.--connection-timeout TIMEOUTβ Specify a connection timeoutTIMEOUT(in seconds).--request-timeout TIMEOUTβ Specify a request timeoutTIMEOUT(in seconds).
π SPECIFIC OPTIONS π
--egressβ Specifies an egress rule. Otherwise ingress is assumed. Pick your direction, babe β¨-P,--protocol PROTOCOLβ May be either a protocol name or a protocol number. Note that non-VPC security groups only allowtcp,udpandicmprules. For non-VPC groups the protocol may be left blank, in which case it will default totcpif a source subnet is specified, totcpandudpif a source group and port range are specified, and totcp,udpandicmpif only a source group is specified. For VPC groups the protocolallmust be explicitly specified. (yes, explicitly. no shortcuts. π)-p,--port-range PORT-RANGEβ Range of ports to open. If thetcporudpprotocol are specified (or implied by default), then the range of ports to grant access to may optionally be specified as a single integer, or as a range (min-max). Specifying-1defaults to all ports.-t,--icmp-type-code TYPE:CODEβ icmp type and code. If theicmpprotocol is specified, then icmp type and code may optionally be specified astype:code, where both type and code are integers and compliant with RFC792. Type or code (or both) may be specified as-1which is a wildcard covering all types or codes.-o,--source-or-dest-group SOURCE-OR-DEST-GROUP [--source-or-dest-group...]β Source or destination security group to be authorized, specified as an EC2 security group name, e.g.default. This may be specified more than once to allow network traffic from multiple security groups.-u,--source-or-dest-group-user SOURCE-OR-DEST-GROUP-USER [--source-or-dest-group-user...]β The owner of the security group specified using-o. If specified only once, the same user will be used for all specified groups. However, if specified once per-o, each user is mapped to a group in order. Anything else is invalid. This option is invalid for VPC security groups. VPC source groups must be owned by the authorizing user.-s,--cidr CIDRβ The network source from which traffic is to be authorized in the case of an ingress request, or to which traffic is to be authorized in the case of an egress request. Specified as a CIDR subnet range, e.g.205.192.8.45/24. This may be specified more than once to allow traffic from multiple subnets. If no subnet and no group are specified, this will default to the wildcard CIDR0.0.0.0/0.--source-subnetβ Like--cidr, but for ingress requests only. For backward compatibility.--dest-subnetβ Like--cidr, but for egress requests only. For backward compatibility.
π SEE ALSO π
http://docs.amazonwebservices.com/AWSEC2/2014-05-01/CommandLineReferencehttp://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference
and that's the whole page, no cap π«Ά go forth and revoke responsibly, my little cloud gremlin. mwah π
π this masterpiece of a manual came to you from the EC2 API command line tools, version 1.6.14.1, api=2014-05-01 β she's a lil vintage, she's a lil iconic, and she ate. periodt. πβ¨
π¦ where this page comes from
- ubuntu jammy: ec2-api-tools 1.6.14.1-0ubuntu1
- ubuntu noble: ec2-api-tools 1.6.14.1-0ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms