ã¿ãã§ã.
ECS é¢é£ã¢ãããã¼ãã§ãããã¤ç¶æ³ã確èªã§ãã API ã®ãµãã¼ããçºè¡¨ããã¾ãã.æ®æ®µãããã¤ã®éã¯ã³ã³ã½ã¼ã«ã§ç¢ºèªãè¡ã£ã¦ããã®ã§ãã®æéãä¸å®è§£æ¶ããããã ã¨æã,ã©ããªç¢ºèªãåããã®ããæå
㧠CLI ã試ãã¦ã¿ã¾ã.
aws.amazon.com
aws.amazon.com
ä»åã¢ãããã¼ãæ¦è¦
ä»åçºè¡¨ããã API ã¯listServiceDeployments
, describeServiceRevisions
, describeServiceDeployment
ã«ãªãã¾ã.ã¾ã,ECS ãµã¼ãã¹ã®ãããã¤å±¥æ´ã90 æ¥éä¿æããã¦ã³ã³ã½ã¼ã«ã¨AWS CLI ã§ç¢ºèªãå¯è½ã«ãªãã¾ãã.ãã®è¨äºã§ã¯è¿½å ããã API ã®æåã CLI ã§ç¢ºèªããå
容ãã¾ã¨ãã¦ããã¾ã.ãªã,CLI ã®ãã¼ã¸ã§ã³ã¯ä»¥ä¸ã®ã¨ããã§ã.
$ aws --version
aws-cli/2.19.4 Python/3.12.7 Darwin/23.5.0 source/arm64
listServiceDeployments
listServiceDeployments
ã§ã¯ ECS ãµã¼ãã¹ã®ãããã¤ãã¨ã®ç¶æ³ã確èªã§ããããã«ãªã£ã¦ãã¾ã.list-service-deployments
ãå®è¡ããã¨ä»¥ä¸ã®ä¾ã§ã¯2åã®ãããã¤ã試ããã®ã§ãã®ç¶æ³ã表示ããã¾ãã.
awscli.amazonaws.com
$ aws ecs list-service-deployments --cluster example --service blog-demo
{
"serviceDeployments": [
{
"serviceDeploymentArn": "arn:aws:ecs:ap-northeast-1:111222333444:service-deployment/example/blog-demo/xOuzLGQkLj4Fgx4pScx-F",
"serviceArn": "arn:aws:ecs:ap-northeast-1:111222333444:service/example/blog-demo",
"clusterArn": "arn:aws:ecs:ap-northeast-1:111222333444:cluster/example",
"startedAt": "2024-11-10T14:38:15.960000+09:00",
"createdAt": "2024-11-10T14:38:14.578000+09:00",
"targetServiceRevisionArn": "arn:aws:ecs:ap-northeast-1:111222333444:service-revision/example/blog-demo/0842152099039089140",
"status": "IN_PROGRESS"
},
{
"serviceDeploymentArn": "arn:aws:ecs:ap-northeast-1:111222333444:service-deployment/example/blog-demo/TpNdMFMET_zrLGeqX15se",
"serviceArn": "arn:aws:ecs:ap-northeast-1:111222333444:service/example/blog-demo",
"clusterArn": "arn:aws:ecs:ap-northeast-1:111222333444:cluster/example",
"startedAt": "2024-11-10T14:06:20.206000+09:00",
"createdAt": "2024-11-10T14:06:18.128000+09:00",
"finishedAt": "2024-11-10T14:26:15.246000+09:00",
"targetServiceRevisionArn": "arn:aws:ecs:ap-northeast-1:111222333444:service-revision/example/blog-demo/1308369492597490708",
"status": "ROLLBACK_FAILED",
"statusReason": "No rollback candidate was found to run the rollback."
}
]
}
ã³ã³ã½ã¼ã«ã§ç¢ºèªããã¨,ãããã¤ãã¨ã«èå¥åãæ¯ããã¦å¾è¿°ãã API ã§ç¢ºèªã§ãã,ãããã¤ã®é¢é£æ
å ±ãå¾ãããããã«ãªã£ã¦ããããã§ã.
describeServiceDeployments
describeServiceDeployments
ã§ã¯ ECS ã¿ã¹ã¯æ°ããµã¼ããã ãã¬ã¼ã«ã¼ã®ã¹ãã¼ã¿ã¹ãªã©ãããã¤ãã¨ã®è©³ç´°æ
å ±ãåå¾ã§ãã¾ã.listServiceDeployments
ã¯å
¨ä½ãè¦ã¦,describeServiceDeployments
ã§ã¯åå¥ã®ãããã¤è©³ç´°ã確èªããããã®ç¨éã®ããã§ãã.
awscli.amazonaws.com
$ aws ecs describe-service-deployments --service-deployment-arns arn:aws:ecs:ap-northeast-1:111222333444:service-deployment/example/blog-demo/xOuzLGQkLj4Fgx4pScx-F
{
"serviceDeployments": [
{
"serviceDeploymentArn": "arn:aws:ecs:ap-northeast-1:111222333444:service-deployment/example/blog-demo/xOuzLGQkLj4Fgx4pScx-F",
"serviceArn": "arn:aws:ecs:ap-northeast-1:111222333444:service/example/blog-demo",
"clusterArn": "arn:aws:ecs:ap-northeast-1:111222333444:cluster/example",
"createdAt": "2024-11-10T14:38:14.578000+09:00",
"startedAt": "2024-11-10T14:38:15.960000+09:00",
"updatedAt": "2024-11-10T14:38:16.502000+09:00",
"sourceServiceRevisions": [
{
"arn": "arn:aws:ecs:ap-northeast-1:111222333444:service-revision/example/blog-demo/1308369492597490708",
"requestedTaskCount": 0,
"runningTaskCount": 0,
"pendingTaskCount": 0
}
],
"targetServiceRevision": {
"arn": "arn:aws:ecs:ap-northeast-1:111222333444:service-revision/example/blog-demo/0842152099039089140",
"requestedTaskCount": 0,
"runningTaskCount": 0,
"pendingTaskCount": 0
},
"status": "IN_PROGRESS",
"deploymentConfiguration": {
"deploymentCircuitBreaker": {
"enable": true,
"rollback": true
},
"maximumPercent": 200,
"minimumHealthyPercent": 100
},
"deploymentCircuitBreaker": {
"status": "MONITORING",
"failureCount": 0,
"threshold": 0
},
"alarms": {
"status": "DISABLED"
}
}
],
"failures": []
}
describeServiceRevisions
describeServiceRevisions
ã§ã¯ã©ããã£ã ECS ã¿ã¹ã¯ããããã¤ãããã¨ãã¦ããã®ã(ã¿ã¹ã¯å®ç¾©ã®ãã¼ã¸ã§ã³,ãããã¯ã¼ã¯æ
å ±,ã³ã³ããåç)ãåå¾ã§ãã¾ã.å¾æ¥ã¯åã
ã®ã¿ã¹ã¯å®ç¾©ãè¦ã«è¡ã£ã¦ããã®ããã® API ã§ç¢ºèªã§ããããã«ãªãã¾ãã.
awscli.amazonaws.com
aws ecs describe-service-revisions --service-revision-arns arn:aws:ecs:ap-northeast-1:111222333444:service-revision/example/blog-demo/0842152099039089140
{
"serviceRevisions": [
{
"serviceRevisionArn": "arn:aws:ecs:ap-northeast-1:111222333444:service-revision/example/blog-demo/0842152099039089140",
"serviceArn": "arn:aws:ecs:ap-northeast-1:111222333444:service/example/blog-demo",
"clusterArn": "arn:aws:ecs:ap-northeast-1:111222333444:cluster/example",
"taskDefinition": "arn:aws:ecs:ap-northeast-1:111222333444:task-definition/blog-demo:2",
"launchType": "FARGATE",
"platformVersion": "1.4.0",
"platformFamily": "Linux",
"loadBalancers": [],
"serviceRegistries": [],
"networkConfiguration": {
"awsvpcConfiguration": {
"subnets": [
"subnet-xxx",
"subnet-xxx"
],
"securityGroups": [
"sg-xxx"
],
"assignPublicIp": "DISABLED"
}
},
"containerImages": [
{
"containerName": "demo",
"image": "111222333444.dkr.ecr.ap-northeast-1.amazonaws.com/ecr-public/amazonlinux/amazonlinux:2023"
}
],
"guardDutyEnabled": false,
"createdAt": "2024-11-10T14:38:06.544000+09:00"
}
],
"failures": []
}
ã¾ã¨ã
ECS ãµã¼ãã¹ãããã¤ã«é¢é£ããæ°ãã API ãµãã¼ããåã㦠AWS CLI ã§é¢é£ã³ãã³ãã試ãã¦ã©ããã£ãå
容ãåå¾ã§ããã®ãã確èªãã¾ãã.