From 65e8ba059663df073226d23d105ad26bbba70248 Mon Sep 17 00:00:00 2001 From: dcarrillo Date: Mon, 24 Feb 2020 21:11:09 +0100 Subject: [PATCH] =?UTF-8?q?[=C3=A6ws]=20Add=20aws=5Fsubnet=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/aws/init.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/aws/init.zsh b/modules/aws/init.zsh index 51920ca..7526a09 100644 --- a/modules/aws/init.zsh +++ b/modules/aws/init.zsh @@ -59,6 +59,12 @@ function aws_vpc { --query 'Vpcs[*].{id:VpcId,cidr:CidrBlock,tag:Tags[0].Value}' } +function aws_subnets { + local profile=$(_get_aws_profile) + aws ec2 describe-subnets --profile $profile --output text \ + --query 'Subnets[].[Tags[?Key==`Name`] | [0].Value, SubnetId, VpcId, CidrBlock]' | sort -k1 +} + function aws_ag { local profile=$(_get_aws_profile) aws autoscaling describe-auto-scaling-groups --profile $profile --output ${_aws_output} \