Difference between revisions of "Aws ec2 describe-vpcs"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
 
https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpcs.html
 
https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpcs.html
  
 +
* <code>[[aws ec2]] describe-vpcs --output=text | [[egrep -w]] "Name|VPCS"</code>
 +
* <code>aws ec2 describe-vpcs --output table</code>
 +
 +
 +
aws ec2 describe-vpcs --output table | egrep "[[Name]]|VpcId"
 +
aws ec2 describe-vpcs | grep [[VpcId]]
 +
aws ec2 describe-vpcs | grep -w [[CidrBlock]]
 +
 +
 +
== Examples --output=text ==
 
  [[aws ec2]] describe-vpcs --output=text
 
  [[aws ec2]] describe-vpcs --output=text
 
  VPCS    [[172.31]].0.0/16  dopt-74d4af1f  default True    688850446548    available      vpc-2e452445
 
  VPCS    [[172.31]].0.0/16  dopt-74d4af1f  default True    688850446548    available      vpc-2e452445
Line 7: Line 17:
 
  CIDRBLOCKSTATE  associated
 
  CIDRBLOCKSTATE  associated
  
* <code>[[aws ec2]] describe-vpcs --output=text | [[egrep -w]] "Name|VPCS"</code>
 
* <code>aws ec2 describe-vpcs --output table</code>
 
  
aws ec2 describe-vpcs --output table | egrep "[[Name]]|VpcId"
+
 
aws ec2 describe-vpcs | grep [[VpcId]]
 
aws ec2 describe-vpcs | grep -w [[CidrBlock]]
 
 
   
 
   
 
== Example ==
 
== Example ==

Revision as of 19:19, 24 May 2022

https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpcs.html

  • aws ec2 describe-vpcs --output=text | egrep -w "Name|VPCS"
  • aws ec2 describe-vpcs --output table


aws ec2 describe-vpcs --output table | egrep "Name|VpcId"
aws ec2 describe-vpcs | grep VpcId
aws ec2 describe-vpcs | grep -w CidrBlock


Examples --output=text

aws ec2 describe-vpcs --output=text
VPCS    172.31.0.0/16   dopt-74d4af1f   default True    688850446548    available       vpc-2e452445
CIDRBLOCKASSOCIATIONSET vpc-cidr-assoc-a74320cc 172.31.0.0/16
CIDRBLOCKSTATE  associated



Example

aws ec2 describe-vpcs
{
    "Vpcs": [
        {
            "CidrBlock": "172.31.0.0/16",
            "DhcpOptionsId": "dopt-74d4af1f",
            "State": "available",
            "VpcId": "vpc-2e452445",
            "OwnerId": "688850446548",
            "InstanceTenancy": "default",
            "CidrBlockAssociationSet": [
                {
                    "AssociationId": "vpc-cidr-assoc-a74320cc",
                    "CidrBlock": "172.31.0.0/16",
                    "CidrBlockState": {
                        "State": "associated"
                    }
                }
            ],
            "IsDefault": true
        }
    ]
}


Amazon doc example

{
    "Vpcs": [
        {
            "CidrBlock": "10.0.0.0/16",
            "DhcpOptionsId": "dopt-19edf471",
            "State": "available",
            "VpcId": "vpc-06e4ab6c6cEXAMPLE",
            "OwnerId": "111122223333",
            "InstanceTenancy": "default",
            "CidrBlockAssociationSet": [
                {
                    "AssociationId": "vpc-cidr-assoc-00b17b4eddEXAMPLE",
                    "CidrBlock": "10.0.0.0/16",
                    "CidrBlockState": {
                        "State": "associated"
                    }
                }
            ],
            "IsDefault": false,
            "Tags": [
                {
                    "Key": "Name",
                    "Value": "Shared VPC"
                }
            ]
        }
    ]
}

Related

See also

Advertising: