
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"

![[Solved] Git Pushでエラー | error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 send-pack: unexpected disconnect while reading sideband packet Writing objects: 100% (9/9), 2.30 MiB | 4.19 MiB/s, done. Total 9 (delta 5), reused 0 (delta 0), pack-reused 0 fatal: the remote end hung up unexpectedly](https://www.yuulinux.tokyo/contents/wp-content/uploads/2024/06/GitHub-Logo-1-e1718593223403-150x150.png)




