{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ecs/json-schema/amazon-ecs-create-express-gateway-service-request-schema.json",
  "title": "CreateExpressGatewayServiceRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ecs-express-gateway-service-api-openapi.yml#/components/schemas/CreateExpressGatewayServiceRequest",
  "type": "object",
  "properties": {
    "executionRoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the task execution role that grants the Amazon ECS container agent permission to make Amazon Web Services API calls on your behalf. This role is required for Amazon ECS to pull container images from Amazon ECR, send container logs to Amazon CloudWatch Logs, and retrieve sensitive data from Amazon Web Services Systems Manager Parameter Store or Amazon Web Services Secrets Manager. The execution role must include the AmazonECSTaskExecutionRolePolicy managed policy or equivalent permissions. For Express services, this role is used during task startup and runtime "
    },
    "infrastructureRoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the infrastructure role that grants Amazon ECS permission to create and manage Amazon Web Services resources on your behalf for the Express service. This role is used to provision and manage Application Load Balancers, target groups, security groups, auto-scaling policies, and other Amazon Web Services infrastructure components. The infrastructure role must include permissions for Elastic Load Balancing, Application Auto Scaling, Amazon EC2 (for security groups), and other services required for managed infrastructure. This role is only used during Express serv"
    },
    "serviceName": {
      "type": "string",
      "description": "The name of the Express service. This name must be unique within the specified cluster and can contain up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens. The name is used to identify the service in the Amazon ECS console and API operations. If you don't specify a service name, Amazon ECS generates a unique name for the service. The service name becomes part of the service ARN and cannot be changed after the service is created."
    },
    "cluster": {
      "type": "string",
      "description": "The short name or full Amazon Resource Name (ARN) of the cluster on which to create the Express service. If you do not specify a cluster, the default cluster is assumed."
    },
    "healthCheckPath": {
      "type": "string",
      "description": "The path on the container that the Application Load Balancer uses for health checks. This should be a valid HTTP endpoint that returns a successful response (HTTP 200) when the application is healthy. If not specified, the default health check path is /ping. The health check path must start with a forward slash and can include query parameters. Examples: /health, /api/status, /ping?format=json."
    },
    "primaryContainer": {
      "$ref": "#/$defs/ExpressGatewayContainer"
    },
    "taskRoleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. This role allows your application code to access other Amazon Web Services services securely. The task role is different from the execution role. While the execution role is used by the Amazon ECS agent to set up the task, the task role is used by your application code running inside the container to make Amazon Web Services API calls. If your application doesn't need to access Amazon Web Services services, you can omit this parameter."
    },
    "networkConfiguration": {
      "$ref": "#/$defs/ExpressGatewayServiceNetworkConfiguration"
    },
    "cpu": {
      "type": "string",
      "description": "The number of CPU units used by the task. This parameter determines the CPU allocation for each task in the Express service. The default value for an Express service is 256 (.25 vCPU)."
    },
    "memory": {
      "type": "string",
      "description": "The amount of memory (in MiB) used by the task. This parameter determines the memory allocation for each task in the Express service. The default value for an express service is 512 MiB."
    },
    "cpuArchitecture": {
      "type": "string",
      "enum": [
        "X86_64",
        "ARM64"
      ],
      "description": "The CPU architecture that the task runs on. If you don't specify a value, the default is X86_64. Valid values: X86_64 - The x86 64-bit architecture. ARM64 - The 64-bit ARM architecture. Ensure that the container image you specify supports the architecture you choose. The operating system family for an Express service is always LINUX. You can't specify cpuArchitecture together with taskDefinitionArn."
    },
    "scalingTarget": {
      "$ref": "#/$defs/ExpressGatewayScalingTarget"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "The metadata that you apply to the Express service to help categorize and organize it. Each tag consists of a key and an optional value. You can apply up to 50 tags to a service."
    },
    "taskDefinitionArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of a task definition to use to create the Express Gateway service. This allows you to manage your own task definition, giving you more control over the service configuration such as adding sidecar containers. The task definition must have a container named Main with a single TCP port mapping that includes a container port and port name. The task definition must also have FARGATE compatibility. If you provide a task definition ARN, you cannot also specify primaryContainer, executionRoleArn, taskRoleArn, cpu, memory, or cpuArchitecture."
    }
  },
  "required": [
    "infrastructureRoleArn"
  ],
  "$defs": {
    "ExpressGatewayContainer": {
      "type": "object",
      "properties": {
        "image": {
          "type": "string",
          "description": "The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. For Express services, the image typically contains a web application that listens on the specified container port. The image can be stored in Amazon ECR, Docker Hub, or any other container registry accessible to your execution role."
        },
        "containerPort": {
          "type": "integer",
          "description": "The port number on the container that receives traffic from the load balancer. Default is 80."
        },
        "awsLogsConfiguration": {
          "$ref": "#/$defs/ExpressGatewayServiceAwsLogsConfiguration"
        },
        "repositoryCredentials": {
          "$ref": "#/$defs/ExpressGatewayRepositoryCredentials"
        },
        "command": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The command that is passed to the container."
        },
        "environment": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KeyValuePair"
          },
          "description": "The environment variables to pass to the container."
        },
        "secrets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Secret"
          },
          "description": "The secrets to pass to the container."
        }
      },
      "required": [
        "image"
      ]
    },
    "ExpressGatewayRepositoryCredentials": {
      "type": "object",
      "properties": {
        "credentialsParameter": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the secret containing the private repository credentials."
        }
      }
    },
    "ExpressGatewayScalingTarget": {
      "type": "object",
      "properties": {
        "minTaskCount": {
          "type": "integer",
          "description": "The minimum number of tasks to run in the Express service."
        },
        "maxTaskCount": {
          "type": "integer",
          "description": "The maximum number of tasks to run in the Express service."
        },
        "autoScalingMetric": {
          "type": "string",
          "enum": [
            "AVERAGE_CPU",
            "AVERAGE_MEMORY",
            "REQUEST_COUNT_PER_TARGET"
          ],
          "description": "The metric used for auto-scaling decisions. The default metric used for an Express service is CPUUtilization."
        },
        "autoScalingTargetValue": {
          "type": "integer",
          "description": "The target value for the auto-scaling metric. The default value for an Express service is 60."
        }
      }
    },
    "ExpressGatewayServiceAwsLogsConfiguration": {
      "type": "object",
      "properties": {
        "logGroup": {
          "type": "string",
          "description": "The name of the CloudWatch Logs log group to send container logs to."
        },
        "logStreamPrefix": {
          "type": "string",
          "description": "The prefix for the CloudWatch Logs log stream names. The default for an Express service is ecs."
        }
      },
      "required": [
        "logGroup",
        "logStreamPrefix"
      ]
    },
    "ExpressGatewayServiceNetworkConfiguration": {
      "type": "object",
      "properties": {
        "securityGroups": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the security groups associated with the Express service."
        },
        "subnets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IDs of the subnets associated with the Express service."
        }
      }
    },
    "KeyValuePair": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the key-value pair. For environment variables, this is the name of the environment variable."
        },
        "value": {
          "type": "string",
          "description": "The value of the key-value pair. For environment variables, this is the value of the environment variable."
        }
      }
    },
    "Secret": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the secret."
        },
        "valueFrom": {
          "type": "string",
          "description": "The secret to expose to the container. The supported values are either the full ARN of the Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store. For information about the require Identity and Access Management permissions, see Required IAM permissions for Amazon ECS secrets (for Secrets Manager) or Required IAM permissions for Amazon ECS secrets (for Systems Manager Parameter store) in the Amazon Elastic Container Service Developer Guide. If the SSM Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the full A"
        }
      },
      "required": [
        "name",
        "valueFrom"
      ]
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values."
        },
        "value": {
          "type": "string",
          "description": "The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key)."
        }
      }
    }
  }
}