事象
EC2にて用意したWindowsServerに対してSystem Manager > Fleet Manager > Remote Desktop にてキーペアを指定して接続を試みるも以下のエラーとなる。
An error occurred while calling the StartConnection API operation. AccessDeniedException: User: arn:aws:iam::xx:user/xx is not authorized to perform: ssm-guiconnect:StartConnection on resource: arn:aws:ec2:xx:instance/*
環境情報
aws --version aws-cli/1.19.112 Python/2.7.18 Linux/4.14.322-244.536.amzn2.x86_64 botocore/1.20.112
解決策
接続を試みるユーザに対してIAMにて以下の権限を付与する。
{ "Sid": "xx", "Effect": "Allow", "Action": [ "ssm-guiconnect:*" ], "Resource": "*" } }
同権限を付与すると問題なく接続ができる。
以下、補足です。
補足
IAM上のサービスでいうと「GUI Connect」を選択し、以下の権限を付与する必要があります。
- GetConnection
- CancelConnection
- StartConnection
尚、AWSコンソール上は以下のように表示されます。
以上。