Skip to content

Instantly share code, notes, and snippets.

@amanjuman
Last active December 15, 2020 17:50
Show Gist options
  • Save amanjuman/40e867dae73a44b58f1e238dcbb6acfc to your computer and use it in GitHub Desktop.
Save amanjuman/40e867dae73a44b58f1e238dcbb6acfc to your computer and use it in GitHub Desktop.
Amazon EC2 Instance Connect Permission for Entire Account
Install EC2 Connect Agent:
UBUNTU: sudo apt-get update && sudo apt-get install ec2-instance-connect
CentOS: sudo yum install ec2-instance-connect
Policy Name; AWSEC2ConnectFromConsole
JSON File:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ec2-instance-connect:SendSSHPublicKey",
"Resource": "*",
"Condition": {
"StringEquals": {
"ec2:osuser": [
"ubuntu",
"ec2-user",
"centos",
"bitnami"
]
}
}
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "ec2:DescribeInstances",
"Resource": "*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment