Last active
December 15, 2020 17:50
-
-
Save amanjuman/40e867dae73a44b58f1e238dcbb6acfc to your computer and use it in GitHub Desktop.
Amazon EC2 Instance Connect Permission for Entire Account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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