= AWS/ContainersEcsFargate =
 * Great aws diagram  from https://jessicadeen.com/
   * [[attachment:BoaP-CON310-lightmode.webp|ECS-Info-Graphic]]

 * If container deployed to ECS with role, that allows SSM connectivity and the execute permisson, login with {{{
aws ecs execute-command --profile <accountcredentials> --cluster <ecs-cluster-name> --task <89b..ed5 --container <name> --command "/bin/bash" --interactive
}}}

== Get Ecs container environment info ==
 * Curl $ECS_CONTAINER_METADATA_URI_V4 {{{
# curl -s $ECS_CONTAINER_METADATA_URI_V4

{"DockerId":"7c6e...658",
"Name":"uiweb","DockerName":"uiweb",
"Image":"666...444.dkr.ecr.ap-southeast-2.amazonaws.com/uiweb:20220101_cccc",
"ImageID":"sha256:01...772c",
"Labels":{"com.amazonaws.ecs.cluster":"arn:aws:ecs:ap-southeast-2:0123456789:cluster/uiweb",
          "com.amazonaws.ecs.container-name":"uiweb",
          "com.amazonaws.ecs.task-arn":"arn:aws:ecs:ap-southeast-2:0123456789:task/uiweb/7c6...b9",
          "com.amazonaws.ecs.task-definition-family":"ui_web_dev",
          "com.amazonaws.ecs.task-definition-version":"50"
         },
"DesiredStatus":"RUNNING",
"KnownStatus":"RUNNING",
"Limits":{"CPU":2},
"CreatedAt":"2022-05-11T02:33:06.211176119Z",
"StartedAt":"2022-05-11T02:33:06.211176119Z",
"Type":"NORMAL",
"Health":{"status":"HEALTHY","statusSince":"2022-05-11T02:33:07.830012145Z",
          "output":"  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n
          Dload  Upload   Total   Spent    Left  Speed\n\r
          0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r
          100   644  100   644    0     0   8702      0 --:--:-- --:--:-- --:--:--  8702\n"},
"Networks":[{"NetworkMode":"awsvpc","IPv4Addresses":["10.11.11.40"],
"AttachmentIndex":0,"MACAddress":"06:b8:e5:4f:da:30",
"IPv4SubnetCIDRBlock":"10.11.11.0/24",
"DomainNameServers":["10.11.11.2"],
"DomainNameSearchList":["ap-southeast-2.compute.internal"],
"PrivateDNSName":"ip-10-11-31-41.ap-southeast-2.compute.internal","SubnetGatewayIpv4Address":"10.11.11.1/24"}],
"ContainerARN":"arn:aws:ecs:ap-southeast-2:0123456789:container/uiweb/7c6...0be0",
"LogOptions":{
              "awslogs-group":"/aws/ecs/ui_web",
              "awslogs-region":"ap-southeast-2",
               "awslogs-stream":"ui-web/ui-web/7c...9b9"
},
"LogDriver":"awslogs"}
}}}