# Get EC2 instancesawsec2describe-instancesawsec2describe-instance-status#Get status from running instances# Get user data from each ec2 instancefor instanceid in $(aws ec2 describe-instances --profile <profile> --region us-west-2 | grep -Eo '"i-[a-zA-Z0-9]+' | tr -d '"'); do
echo"Instance ID: $instanceid"aws ec2 describe-instance-attribute --profile <profile> --region us-west-2 --instance-id "$instanceid" --attribute userData | jq ".UserData.Value" | tr -d '"' | base64 -d
echo""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
# List internet-facing ELBsawselbdescribe-load-balancersaws elb describe-load-balancers | jq '.LoadBalancerDescriptions[]| select( .Scheme | contains("internet-facing"))|.DNSName'
# DONT FORGET TO CHECK VERSION 2awselbv2describe-load-balancersawselbv2describe-load-balancers|jq'.LoadBalancers[].DNSName'awselbv2describe-listeners--load-balancer-arn<load_balancer_arn>
启动模板与自动扩展组
枚举
# Launch templatesawsec2describe-launch-templatesawsec2describe-launch-templates--launch-template-id<launch_template_id>## Get details, like user dataawsec2describe-launch-template-versions--launch-template-id<launch_template_id># Autoscalingawsautoscalingdescribe-auto-scaling-groupsawsautoscalingdescribe-auto-scaling-instancesawsautoscalingdescribe-launch-configurationsawsautoscalingdescribe-load-balancer-target-groupsawsautoscalingdescribe-load-balancers
# VPN endpoints## Check used subnetwork, authentication, SGs, connected...awsec2describe-client-vpn-endpoints## Get AWS network info related to the vpn endpointawsec2describe-client-vpn-target-networks--client-vpn-endpoint-id<id>## Get AWS subnet & ip range the VPN iconnected toawsec2describe-client-vpn-routes--client-vpn-endpoint-id<id>## Check authorization rulesawsec2describe-client-vpn-authorization-rules--client-vpn-endpoint-id<id>## Get current connections to the VPN endpointawsec2describe-client-vpn-connections--client-vpn-endpoint-id<id># Get VPN gateways and check with which VPC each is connectedawsec2describe-vpn-gateways# Get VPN site-to-site connectionsawsec2describe-vpn-connections