Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

AWS cli 세팅하기 참고.

https://stedolan.github.io/jq/tutorial/ 기본 예제부터 이해함

특정 값만 뽑을 때는 select 이용.

$  sg_address="aws_security_group.$sg"
$  cat show-json  | jq .values.root_module[]  \
| jq -r --arg sg_address "$sg_address" '.[] | select(.address==$sg_address)' \
| jq '. | {address: .address, id: .values.id, name: .values.name}'

https://stedolan.github.io/jq/manual/

jq 에서 variable 넘기는 것.

https://stackoverflow.com/questions/40027395/passing-bash-variable-to-jq

   projectID=$(jq -r --arg EMAILID "$EMAILID" '
        .resource[]
        | select(.username==$EMAILID) 
        | .id' file.json)

  • No labels