Running ec2-describe-instances in EC2
By : Asif Khawaja
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further Greg , You need to pass security key and access key as parameters for that command , else you can set those as environmental variables also , you will get the those security and access keys from your account by accessing the link provided by @datasage in above answer .
|
AWS-cli ec2 describe instances
By : Valerie Mullen
Date : March 29 2020, 07:55 AM
Hope that helps i am digging on aws cli and from past 5 hours i struggling with 2 cli commands , To describe all instances with Tag "NAME" Use: code :
aws ec2 describe-instances --filters "Name=tag-key,Values=Name"
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId, Tags[?Key==`Name`].Value[0]]'
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId, Tags[?Key==`Name`], Tags[?Key==`Name`].Value[]]'
aws ec2 describe-instances --filters "Name=tag:Purpose,Values=test"
aws ec2 describe-instances --instance-ids i-1234567890abcdef0
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(contains({Tags: [{Key: "Purpose"} ]}) | not)'
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(contains({Tags: [{Key: "Name"}, {Value: "testbox1"}]}) | not)'
aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(contains({Tags: [{Key: ""}, {Value: ""}]}) | not)'
|
aws cli describe-instances without a VpcId
By : Hugo Nascimento
Date : October 23 2020, 01:08 AM
I wish this help you This cli command will list all the instances which doesn't have VpcId. code :
aws ec2 describe-instances --region us-east-1 --query 'Reservations[*].Instances[?!not_null(VpcId)] | [].[InstanceId]' --output text
aws ec2 describe-instances --region us-east-1 --query 'Reservations[*].Instances[?not_null(VpcId)] | [].[InstanceId]' --output text
|
AWSLambdaBasicExecutionRole not able to describe instances
By : user3384541
Date : March 29 2020, 07:55 AM
This might help you First of all, AWSLambdaBasicExecutionRole is a POLICY not a role despite what its name implies. And that policy gives only the following permissions: code :
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "*"
}
]
}
|
Use AWS JS SDK in node to describe all ec2 instances
By : Rickshawman
Date : March 29 2020, 07:55 AM
|