{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-lightsail/json-schema/amazon-lightsail-create-container-service-request-schema.json",
  "title": "CreateContainerServiceRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-lightsail-container-services-api-openapi.yml#/components/schemas/CreateContainerServiceRequest",
  "type": "object",
  "properties": {
    "serviceName": {
      "allOf": [
        {
          "$ref": "#/$defs/ContainerServiceName"
        }
      ],
      "description": "The name for the container service. The name that you specify for your container service will make up part of its default domain. The default domain of a container service is typically https:// . . .cs.amazonlightsail.com . If the name of your container service is container-service-1 , and it's located in the US East (Ohio) Amazon Web Services Region ( us-east-2 ), then the domain for your container service will be like the following example: https://container-service-1.ur4EXAMPLE2uq.us-east-2.cs.amazonlightsail.com The following are the requirements for container service names: Must be unique within each Amazon Web Services Region in your Lightsail account. Must contain 1 to 63 characters. Must contain only alphanumeric characters and hyphens. A hyphen (-) can separate words but cannot be at the start or end of the name."
    },
    "power": {
      "allOf": [
        {
          "$ref": "#/$defs/ContainerServicePowerName"
        }
      ],
      "description": "The power specification for the container service. The power specifies the amount of memory, vCPUs, and base monthly cost of each node of the container service. The power and scale of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the power with the scale (the number of nodes) of the service. Use the GetContainerServicePowers action to get a list of power options that you can specify using this parameter, and their base monthly cost."
    },
    "scale": {
      "allOf": [
        {
          "$ref": "#/$defs/ContainerServiceScale"
        }
      ],
      "description": "The scale specification for the container service. The scale specifies the allocated compute nodes of the container service. The power and scale of a container service makes up its configured capacity. To determine the monthly price of your container service, multiply the base price of the power with the scale (the number of nodes) of the service."
    },
    "tags": {
      "allOf": [
        {
          "$ref": "#/$defs/TagList"
        }
      ],
      "description": "The tag keys and optional values to add to the container service during create. Use the TagResource action to tag a resource after it's created. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide ."
    },
    "publicDomainNames": {
      "allOf": [
        {
          "$ref": "#/$defs/ContainerServicePublicDomains"
        }
      ],
      "description": "The public domain names to use with the container service, such as example.com and www.example.com . You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container configured as the public endpoint of your container service. If you don't specify public domain names, then you can use the default domain of the container service. You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the CreateCertificate action to create a certificate for the public domain names you want to use with your container service. You can specify public domain names using a string to array map as shown in the example later on this page."
    },
    "deployment": {
      "allOf": [
        {
          "$ref": "#/$defs/ContainerServiceDeploymentRequest"
        }
      ],
      "description": "An object that describes a deployment for the container service. A deployment specifies the containers that will be launched on the container service and their settings, such as the ports to open, the environment variables to apply, and the launch command to run. It also specifies the container that will serve as the public endpoint of the deployment and its settings, such as the HTTP or HTTPS port to use, and the health check configuration."
    },
    "privateRegistryAccess": {
      "allOf": [
        {
          "$ref": "#/$defs/PrivateRegistryAccessRequest"
        }
      ],
      "description": "An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories. For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide ."
    }
  },
  "required": [
    "serviceName",
    "power",
    "scale"
  ],
  "$defs": {
    "Container": {
      "type": "object",
      "properties": {
        "image": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The name of the image used for the container. Container images sourced from your Lightsail container service, that are registered and stored on your service, start with a colon ( : ). For example, if your container service name is container-service-1 , the container image label is mystaticsite , and you want to use the third ( 3 ) version of the registered container image, then you should specify :container-service-1.mystaticsite.3 . To use the latest version of a container image, specify latest instead of a version number (for example, :container-service-1.mystaticsite.latest ). Lightsail will automatically use the highest numbered version of the registered container image. Container images sourced from a public registry like Docker Hub don't start with a colon. For example, nginx:latest or nginx ."
        },
        "command": {
          "allOf": [
            {
              "$ref": "#/$defs/StringList"
            }
          ],
          "description": "The launch command for the container."
        },
        "environment": {
          "allOf": [
            {
              "$ref": "#/$defs/Environment"
            }
          ],
          "description": "The environment variables of the container."
        },
        "ports": {
          "allOf": [
            {
              "$ref": "#/$defs/PortMap"
            }
          ],
          "description": "The open firewall ports of the container."
        }
      },
      "description": "Describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service."
    },
    "ContainerMap": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Container"
      }
    },
    "ContainerServiceDeploymentRequest": {
      "type": "object",
      "properties": {
        "containers": {
          "allOf": [
            {
              "$ref": "#/$defs/ContainerMap"
            }
          ],
          "description": "An object that describes the configuration for the containers of the deployment."
        },
        "publicEndpoint": {
          "allOf": [
            {
              "$ref": "#/$defs/EndpointRequest"
            }
          ],
          "description": "An object that describes the endpoint of the deployment."
        }
      },
      "description": "Describes a container deployment configuration of an Amazon Lightsail container service. A deployment specifies the settings, such as the ports and launch command, of containers that are deployed to your container service."
    },
    "ContainerServiceECRImagePullerRoleRequest": {
      "type": "object",
      "properties": {
        "isActive": {
          "allOf": [
            {
              "$ref": "#/$defs/boolean"
            }
          ],
          "description": "A Boolean value that indicates whether to activate the role."
        }
      },
      "description": "Describes a request to activate or deactivate the role that you can use to grant an Amazon Lightsail container service access to Amazon Elastic Container Registry (Amazon ECR) private repositories. When activated, Lightsail creates an Identity and Access Management (IAM) role for the specified Lightsail container service. You can use the ARN of the role to create a trust relationship between your Lightsail container service and an Amazon ECR private repository in your Amazon Web Services account. This allows your container service to pull images from Amazon ECR private repositories. For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide ."
    },
    "ContainerServiceHealthCheckConfig": {
      "type": "object",
      "properties": {
        "healthyThreshold": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The number of consecutive health checks successes required before moving the container to the Healthy state. The default value is 2 ."
        },
        "unhealthyThreshold": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The number of consecutive health check failures required before moving the container to the Unhealthy state. The default value is 2 ."
        },
        "timeoutSeconds": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The amount of time, in seconds, during which no response means a failed health check. You can specify between 2 and 60 seconds. The default value is 2 ."
        },
        "intervalSeconds": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5 ."
        },
        "path": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The path on the container on which to perform the health check. The default value is / ."
        },
        "successCodes": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The HTTP codes to use when checking for a successful response from a container. You can specify values between 200 and 499 . You can specify multiple values (for example, 200,202 ) or a range of values (for example, 200-299 )."
        }
      },
      "description": "Describes the health check configuration of an Amazon Lightsail container service."
    },
    "ContainerServiceName": {
      "type": "string",
      "pattern": "^[a-z0-9]{1,2}|[a-z0-9][a-z0-9-]+[a-z0-9]$",
      "minLength": 1,
      "maxLength": 63
    },
    "ContainerServicePowerName": {
      "type": "string",
      "enum": [
        "nano",
        "micro",
        "small",
        "medium",
        "large",
        "xlarge"
      ]
    },
    "ContainerServiceProtocol": {
      "type": "string",
      "enum": [
        "HTTP",
        "HTTPS",
        "TCP",
        "UDP"
      ]
    },
    "ContainerServicePublicDomains": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ContainerServicePublicDomainsList"
      }
    },
    "ContainerServicePublicDomainsList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/string"
      }
    },
    "ContainerServiceScale": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20
    },
    "EndpointRequest": {
      "type": "object",
      "properties": {
        "containerName": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The name of the container for the endpoint."
        },
        "containerPort": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The port of the container to which traffic is forwarded to."
        },
        "healthCheck": {
          "allOf": [
            {
              "$ref": "#/$defs/ContainerServiceHealthCheckConfig"
            }
          ],
          "description": "An object that describes the health check configuration of the container."
        }
      },
      "required": [
        "containerName",
        "containerPort"
      ],
      "description": "Describes the settings of a public endpoint for an Amazon Lightsail container service."
    },
    "Environment": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/string"
      }
    },
    "PortMap": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/ContainerServiceProtocol"
      }
    },
    "PrivateRegistryAccessRequest": {
      "type": "object",
      "properties": {
        "ecrImagePullerRole": {
          "allOf": [
            {
              "$ref": "#/$defs/ContainerServiceECRImagePullerRoleRequest"
            }
          ],
          "description": "An object to describe a request to activate or deactivate the role that you can use to grant an Amazon Lightsail container service access to Amazon Elastic Container Registry (Amazon ECR) private repositories."
        }
      },
      "description": "Describes a request to configure an Amazon Lightsail container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories. For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide ."
    },
    "StringList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/string"
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "allOf": [
            {
              "$ref": "#/$defs/TagKey"
            }
          ],
          "description": "The key of the tag. Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @"
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/TagValue"
            }
          ],
          "description": "The value of the tag. Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @"
        }
      },
      "description": "Describes a tag key and optional value assigned to an Amazon Lightsail resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide ."
    },
    "TagKey": {
      "type": "string"
    },
    "TagList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      }
    },
    "TagValue": {
      "type": "string"
    },
    "boolean": {
      "type": "boolean"
    },
    "integer": {
      "type": "integer"
    },
    "string": {
      "type": "string"
    }
  }
}