Difference between revisions of "Aws ec2 describe-subnets"
Jump to navigation
Jump to search
(27 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
+ | https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-subnets.html | ||
+ | |||
* <code>[[aws ec2]] describe-subnets</code> | * <code>[[aws ec2]] describe-subnets</code> | ||
* <code>aws ec2 describe-subnets | grep [[VpcId]]</code> | * <code>aws ec2 describe-subnets | grep [[VpcId]]</code> | ||
+ | * <code>aws ec2 describe-subnets --output json | grep [[SubnetId]]</code> | ||
+ | * <code>[[aws ec2]] describe-subnets [[--output=text]] | grep Name</code> | ||
+ | * <code>[[aws ec2]] describe-subnets [[--output=table]] | grep Name</code> | ||
+ | * <code>aws ec2 describe-subnets --filters Name=[[vpc-id]],Values=vpc-0987654321</code> | ||
+ | * <code>aws ec2 describe-subnets --filters Name=vpc-id,Values=vpc-0987654321 --output table | egrep "[[MapPublicIpOnLaunch]]|Name|CidrBlock"</code> | ||
+ | * <code>aws ec2 describe-subnets | grep -i [[DefaultForAz]]</code> | ||
+ | * <code>aws ec2 describe-subnets | egrep -iw "AvailabilityZone|vpcid|[[MapPublicIpOnLaunch]]"</code> | ||
− | + | <code>[[aws ec2]] describe-subnets [[--output=table]]</code> | |
||+-----------------------------+---------------------------------------------------------------------+|| | ||+-----------------------------+---------------------------------------------------------------------+|| | ||
Line 9: | Line 18: | ||
|+------------------------------+----------------------------------------------------------------------+| | |+------------------------------+----------------------------------------------------------------------+| | ||
|| AssignIpv6AddressOnCreation | False || | || AssignIpv6AddressOnCreation | False || | ||
− | || AvailabilityZone | us-west-2a || | + | || [[AvailabilityZone]] | us-west-2a || |
|| AvailabilityZoneId | usw2-az2 || | || AvailabilityZoneId | usw2-az2 || | ||
|| AvailableIpAddressCount | 239 || | || AvailableIpAddressCount | 239 || | ||
Line 15: | Line 24: | ||
|| DefaultForAz | False || | || DefaultForAz | False || | ||
|| MapCustomerOwnedIpOnLaunch | False || | || MapCustomerOwnedIpOnLaunch | False || | ||
− | || MapPublicIpOnLaunch | False || | + | || [[MapPublicIpOnLaunch]] | False || |
|| OwnerId | 782871186567 || | || OwnerId | 782871186567 || | ||
|| State | available || | || State | available || | ||
Line 30: | Line 39: | ||
== Related == | == Related == | ||
− | * [[ | + | * <code>[[aws ec2 create-subnet]]</code> |
− | * [[AWS VPC]] | + | * [[AWS VPC]], [[AZ]] |
− | * [[aws list all]] | + | * <code>[[aws list all]]</code> |
+ | * <code>[[aws ec2 create-route]]</code> | ||
+ | * <code>[[aws ec2 describe-network-interfaces]] --filters Name=subnet-id,Values=your-subnet-id-here | grep Description</code> | ||
+ | * <code>[[aws ec2 describe-vpcs]]</code> | ||
== See also == | == See also == | ||
+ | * {{aws ec2 subnet}} | ||
+ | * {{aws ec2 vpc}} | ||
* {{aws ec2}} | * {{aws ec2}} | ||
[[Category:AWS]] | [[Category:AWS]] |
Latest revision as of 12:01, 20 October 2023
https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-subnets.html
aws ec2 describe-subnets
aws ec2 describe-subnets | grep VpcId
aws ec2 describe-subnets --output json | grep SubnetId
aws ec2 describe-subnets --output=text | grep Name
aws ec2 describe-subnets --output=table | grep Name
aws ec2 describe-subnets --filters Name=vpc-id,Values=vpc-0987654321
aws ec2 describe-subnets --filters Name=vpc-id,Values=vpc-0987654321 --output table | egrep "MapPublicIpOnLaunch|Name|CidrBlock"
aws ec2 describe-subnets | grep -i DefaultForAz
aws ec2 describe-subnets | egrep -iw "AvailabilityZone|vpcid|MapPublicIpOnLaunch"
aws ec2 describe-subnets --output=table
||+-----------------------------+---------------------------------------------------------------------+|| || Subnets || |+------------------------------+----------------------------------------------------------------------+| || AssignIpv6AddressOnCreation | False || || AvailabilityZone | us-west-2a || || AvailabilityZoneId | usw2-az2 || || AvailableIpAddressCount | 239 || || CidrBlock | 10.0.10.0/24 || || DefaultForAz | False || || MapCustomerOwnedIpOnLaunch | False || || MapPublicIpOnLaunch | False || || OwnerId | 782871186567 || || State | available || || SubnetArn | arn:aws:ec2:us-west-2:782871186567:subnet/subnet-0e038b0cdfcb53b19 || || SubnetId | subnet-0e038b0cdfcb53b19 || || VpcId | vpc-0a89965bb4754b25c || |+------------------------------+----------------------------------------------------------------------+| ||| Tags ||| ||+----------------------------+----------------------------------------------------------------------+|| ||| Key | Value ||| ||+----------------------------+----------------------------------------------------------------------+|| ||| Name | stage-us-west-2a-private-subnet ||| ||| Environment | your_env |||
Related[edit]
aws ec2 create-subnet
- AWS VPC, AZ
aws list all
aws ec2 create-route
aws ec2 describe-network-interfaces --filters Name=subnet-id,Values=your-subnet-id-here | grep Description
aws ec2 describe-vpcs
See also[edit]
- AWS subnets:
AWS::EC2::Subnet, aws ec2 [ create-subnet
|describe-subnets
]--vpc-id
,MapPublicIpOnLaunch
,aws_subnet
AWS VPC
:aws ec2 vpc
,AWS::EC2::VPC
,aws ec2 [ create-vpc
|describe-vpcs
|describe-vpc-peering-connections
|aws ec2 create-vpc-peering-connection | modify-vpc-attribute | create-vpc-endpoint ]
- AWS EC2, AWS::EC2,
aws ec2
[describe-instances | describe-instance-status
|run-instances | terminate-instances | stop-instances
|tags
|describe-vpcs
|describe-addresses
|describe-availability-zones
|describe-subnets
|import-key-pair
|create-key-pair
|create-vpc
|create-internet-gateway
|modify-instance-attribute | ec2-instance-connect | get-console-output
]
Advertising: