How to get the ARN Value of IAM Role in AWS

Viewed 2754

I am trying to run below AWS Cli to get the Role description but i want to filter this command to get ARN. I couldnt get the value but receive "null"

command :


can you provide the correct command to fetch the output of ARN Value

1 Answers

Role is a json object, not a list:

aws iam get-role --role-name cfnrole --query 'Role.[RoleName, Arn]' --output text
Related