Este comando puede ser útil, si tenemos el permiso de ec2:AuthorizeSecurityGroupIngress y deseamos tener acceso a un servicio corriendo en un EC2.
Si deseas exponer públicamente un puerto debes especificar el CIDR en 0.0.0.0/24
Mas comandos
# Get EC2 instancesawsec2describe-instancesawsec2describe-instance-status#Get status from running instances# Get user data from each ec2 instancefor instanceid in $(awsec2describe-instances--profile<profile>--regionus-west-2|grep-Eo'"i-[a-zA-Z0-9]+'|tr-d'"'); doecho"Instance ID: $instanceid"awsec2describe-instance-attribute--profile<profile>--regionus-west-2--instance-id"$instanceid"--attributeuserData|jq".UserData.Value"|tr-d'"'|base64-decho""echo"-------------------"done# Instance profilesawsiamlist-instance-profilesawsiamlist-instance-profiles-for-role--role-name<name># Get tagsawsec2describe-tags# Get volumesawsec2describe-volume-statusawsec2describe-volumes# Get snapshotsawsec2describe-snapshots--owner-idsself# Scheduled instancesawsec2describe-scheduled-instances# Get custom imagesawsec2describe-images--ownersself# Get Elastic IPsawsec2describe-addresses# Get current outputawsec2get-console-output--instance-id [id]# Get VPN customer gatewaysawsec2describe-customer-gatewaysawsec2describe-vpn-gatewaysawsec2describe-vpn-connections# List conversion tasks to upload/download VMsawsec2describe-conversion-tasksawsec2describe-import-image-tasks# Get Bundle Tasksawsec2describe-bundle-tasks# Get Classic Instancesawsec2describe-classic-link-instances# Get Dedicated Hostsawsec2describe-hosts# Get SSH Key Pairsawsec2describe-key-pairs# Get Internet Gatewaysawsec2describe-internet-gateways# Get NAT Gatewaysawsec2describe-nat-gateways# Get subnetworksawsec2describe-subnets# Get FW rulesawsec2describe-network-acls# Get security groupsawsec2describe-security-groups# Get interfacesawsec2describe-network-interfaces# Get routes tableawsec2describe-route-tables# Get VPCsawsec2describe-vpcsawsec2describe-vpc-peering-connections