
ECS Fargateでもコマンドが外部から実行できます。
- SSMが実行できるIAM UserのProfileが必要
もくじ
ECS ServiceにECS Execを有効化
aws ecs update-service --profile {IAM User名} \
--cluster {ECS Cluster ARN} \
--service {ECS Service名} \
--propagate-tags TASK_DEFINITION \
--force-new-deployment \
--enable-execute-command
Terraformの場合
resource "aws_ecs_service" "exampl" {
・・・
# ECS Exec有効化
enable_execute_command = true
enable_execute_commandプロパティで有効化できる。
ECS Execでコンテナにログインしコマンド実行
aws ecs execute-command --profile {IAM User名} \
--region ap-northeast-1 \
--cluster {ECS Cluster ARN} \
--task {ECS Task id} \
--container {ECS コンテナ名} \
--interactive \
--command "nginx -t"

![Plesk12.5.30 25番で待ちうけさせる status=deferred (connect to example.com[111.xxx.yyy.2]:25: Connection refused)](https://www.yuulinux.tokyo/contents/wp-content/uploads/2017/10/plesk25_201710027_2-150x150.jpg)
![PHP Iteratorパターン [PHPによるデザインパターン入門]](https://www.yuulinux.tokyo/contents/wp-content/uploads/2017/09/phpDP_20190407_1-150x150.jpg)

