%curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm"
%sudo yum install -y session-manager-plugin.rpm
以下のコマンドを実行
session-manager-plugin
The Session Manager plugin was installed successfully. Use the AWS CLI to start a session. と出力されれば、OK
##amazon Linux2の場合です。他のディストリビューションは未調査です。
"botocore.exceptions.ClientError: An error occurred (OperationNotPermitted) when calling the StopInstances operation: The instance 'i-xxxxxxxxxyyyyy' may not be stopped. Modify its 'disableApiStop' instance attribute and try again.\n"] ClientError
aws ecr get-login --no-include-email --region ap-northeast-1 > login.sh ←一行です
[ec2-user@ip-10-128-1-19 ECR]$ bash ./login.sh
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/ec2-user/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded ← これが出ればログイン成功