"scheduledExpression": "cron(0 0 * * ? *)"
注册CI/CD输出,看它是否存在问题。检查输出以查看任务是否已成功启动并且没有错误。
确认IAM角色是否正确。确保ECSTaskExecutionRole权限足够,并将它附加到ECS集群上的EC2实例。如果没有角色,您可以使用以下代码创建一个角色:
resource "aws_iam_role" "ecs_task_execution" {
name = "ecs-task-execution"
assume_role_policy = <
resource "aws_ecs_task_definition" "example" {
family = "example"
container_definitions = jsonencode([
{
name = "example"
image = "nginx"
port_mappings = [
{
container_port = 80
host_port = 80
}
]
}
])
}
"deploymentConfiguration": {
"minimumHealthyPercent": 0,
"maximumPercent": 100
}
awslogs
驱动程序将日志