Link to home
Start Free TrialLog in
Avatar of Tom Klemzik
Tom Klemzik

asked on

AWSCLI Help

Hello Experts,

I have created an EFS Filesystem, I am trying to find a script which will give me the below

Input to script : EFS Filesystem ID
Output : {AZ targetIPAddress}

we dont have aws dns, so we are manually mounting using IP address...Here are the steps, I have...

1. The below command will give the Subnet and IP address
# $ aws efs describe-mount-targets --file-system-id fs-e10c82b2 --query 'MountTargets[*].[SubnetId,IpAddress]' --output text
OUTPUT : {SUBNET IPADDRESS}

2. The below command will give me AZ for the subnets
$ aws ec2 describe-subnets --subnet-ids subnet-9456320b --query 'Subnets[].AvailabilityZone' --output text
INPUT :SUBNET
OUTPUT : AVAILABILITY ZONE

How do I combine these 2 scripts to get
- AVAILABILITYZONE IPADDRESS

Please assist
ASKER CERTIFIED SOLUTION
Avatar of Shalom Carmel
Shalom Carmel
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No response, good solution