0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windows PowerShell での SSM 接続コマンドのメモ

Posted at

はじめに

  • 過去にいた企業内で Mac なんてオサレなマシン提供された未来が見えない
  • 客も Windows 多いんだし、Word とか画面壊れるの嫌だし、Windows マンセー
  • すぐに SSM で接続する為のコマンドメモです

手順

プロファイルとインスタンス Name タグを指定

${profile} = {Systems Manager 接続可能なプロファイルを指定}
${InstanceName} = {インスタンス Name タグを指定}

Name タグからインスタンス ID 取得

${InstanceId} = aws ec2 describe-instances `
    --profile ${profile} `
    --filter "Name=tag:Name,Values=${InstanceName}" `
    --query "Reservations[].Instances[].InstanceId" `
    --output text

接続

aws ssm start-session `
    --profile ${profile} `
    --target ${InstanceId}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?