1
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.

プライベートでEC2のWindows Serverを運用する時の覚書

Posted at

はじめに

Windows ServerのEC2をプライベートネットワークで運用する際のもろもろ気づいたことを書きます。

SSMの設定

プライベートサブネットではSSMもつながらないため設定が必要になります。

SSM用のエンドポイント

次の3つのエンドポイントを作成して、対象のサブネットにアタッチします。

  • com.amazonaws.ap-northeast-1.ssm
  • com.amazonaws.ap-northeast-1.ssmmessages
  • com.amazonaws.ap-northeast-1.ec2messages

エンドポイントにはセキュリティグループでhttps(443)のインバウンド設定を付与する。

プライベートリンクのエンドポイントを設置すると、通信の従量課金だけでなく時間単位の課金が発生しますのでご注意。この構成でうっかり1か月過ごすと1万円を超える請求がきます。

SSMエージェント更新のためS3のエンドポイント

次のエンドポイントを作成して、対象のサブネットにアタッチします。

  • com.amazonaws.ap-northeast-1.s3 ゲートウェイ型

対象のS3を絞り込む場合は下記の情報が役に立ちます。

東京リージョン向けのS3バケットポリシーのサンプル
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Principal": "*",
			"Action": "s3:GetObject",
			"Resource": [
				"arn:aws:s3:::aws-windows-downloads-ap-northeast-1/*",
				"arn:aws:s3:::amazon-ssm-ap-northeast-1/*",
				"arn:aws:s3:::amazon-ssm-packages-ap-northeast-1*",
				"arn:aws:s3:::ap-northeast-1-birdwatcher-prod/*",
				"arn:aws:s3:::aws-ssm-document-attachments-ap-northeast-1*",
				"arn:aws:s3:::patch-baseline-snapshot-ap-northeast-1/*",
				"arn:aws:s3:::aws-ssm-ap-northeast-1/*",
				"arn:aws:s3:::aws-patchmanager-macos-ap-northeast-1/*"
			]
		}
	]
}

Windows Updateはどうするか

いまのところNAT ゲートウェイを経由するくらいしかないと思われます。WSUSなどの仕組みを構成することで、通信量を抑えるなどの工夫が必要になります。

Amazon Linuxはエンドポイント経由でできるようです。

おわりに

意外となかったので、新たなことが出てきたら追記します。

1
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
1
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?