Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29446

Query tag value pattern using AWS CLI

$
0
0

Request you help, the output of the below AWS command displays the value of the field Tags[?Key==`te-name`].Value|[0] as below but I wanted to display only the partial string.

Tag: te_name
"SYS:DEV ROOM:L1 CHECK:Y""SYS:TRN ROOM:L2 CHECK:N"

Partial String
Tag: te_name
ROOM:L1
ROOM:L2

eg: Tags[?Key==`te-name`].Value(*ROOM*)

AWS command:

/usr/bin/aws ec2 describe-volumes --filters Name=tag:cloud-environment,Values='XXXX' --query 'Volumes[*].[VolumeId,VolumeType,Size,Attachments[0].InstanceId,Attachments[0].Device,State,Tags[?Key==`cloud-environment`]|[0].Value,Tags[?Key==`cip-created-by`]|[0].Value,Tags[?Key==`te-name`].Value|[0],Encrypted,KmsKeyId]' --output text

Viewing all articles
Browse latest Browse all 29446

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>