{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-app-runner/json-schema/aws-app-runner-create-service-request-schema.json",
  "title": "CreateServiceRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aws-app-runner-aws-app-runner-api-api-openapi.yml#/components/schemas/CreateServiceRequest",
  "type": "object",
  "properties": {
    "ServiceName": {
      "type": "string",
      "description": "A name for the App Runner service. It must be unique across all the running App Runner services in your Amazon Web Services account in the Amazon Web Services Region."
    },
    "SourceConfiguration": {
      "$ref": "#/$defs/SourceConfiguration"
    },
    "InstanceConfiguration": {
      "$ref": "#/$defs/InstanceConfiguration"
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "An optional list of metadata items that you can associate with the App Runner service resource. A tag is a key-value pair."
    },
    "EncryptionConfiguration": {
      "$ref": "#/$defs/EncryptionConfiguration"
    },
    "HealthCheckConfiguration": {
      "$ref": "#/$defs/HealthCheckConfiguration"
    },
    "AutoScalingConfigurationArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. If not provided, App Runner associates the latest revision of a default auto scaling configuration. Specify an ARN with a name and a revision number to associate that revision. For example: arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability/3 Specify just the name to associate the latest revision. For example: arn:aws:apprunner:us-east-1:123456789012:autoscalingconfiguration/high-availability"
    },
    "NetworkConfiguration": {
      "$ref": "#/$defs/NetworkConfiguration"
    },
    "ObservabilityConfiguration": {
      "$ref": "#/$defs/ServiceObservabilityConfiguration"
    }
  },
  "required": [
    "ServiceName",
    "SourceConfiguration"
  ],
  "$defs": {
    "AuthenticationConfiguration": {
      "type": "object",
      "properties": {
        "ConnectionArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the App Runner connection that enables the App Runner service to connect to a source repository. It's required for GitHub code repositories."
        },
        "AccessRoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role that grants the App Runner service access to a source repository. It's required for ECR image repositories (but not for ECR Public repositories)."
        }
      }
    },
    "CodeConfiguration": {
      "type": "object",
      "properties": {
        "ConfigurationSource": {
          "type": "string",
          "enum": [
            "REPOSITORY",
            "API"
          ],
          "description": "The source of the App Runner configuration. Values are interpreted as follows: REPOSITORY – App Runner reads configuration values from the apprunner.yaml file in the source code repository and ignores CodeConfigurationValues. API – App Runner uses configuration values provided in CodeConfigurationValues and ignores the apprunner.yaml file in the source code repository."
        },
        "CodeConfigurationValues": {
          "$ref": "#/$defs/CodeConfigurationValues"
        }
      },
      "required": [
        "ConfigurationSource"
      ]
    },
    "CodeConfigurationValues": {
      "type": "object",
      "properties": {
        "Runtime": {
          "type": "string",
          "enum": [
            "PYTHON_3",
            "NODEJS_12",
            "NODEJS_14",
            "CORRETTO_8",
            "CORRETTO_11",
            "NODEJS_16",
            "GO_1",
            "DOTNET_6",
            "PHP_81",
            "RUBY_31",
            "PYTHON_311",
            "NODEJS_18",
            "NODEJS_22"
          ],
          "description": "A runtime environment type for building and running an App Runner service. It represents a programming language runtime."
        },
        "BuildCommand": {
          "type": "string",
          "description": "The command App Runner runs to build your application."
        },
        "StartCommand": {
          "type": "string",
          "description": "The command App Runner runs to start your application."
        },
        "Port": {
          "type": "string",
          "description": "The port that your application listens to in the container. Default: 8080"
        },
        "RuntimeEnvironmentVariables": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The environment variables that are available to your running App Runner service. An array of key-value pairs."
        },
        "RuntimeEnvironmentSecrets": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "An array of key-value pairs representing the secrets and parameters that get referenced to your service as an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store. If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services Region as the service that you're launching, you can use either the full ARN or name of the secret. If the parameter exists in a different Region, then the full ARN must"
        }
      },
      "required": [
        "Runtime"
      ]
    },
    "CodeRepository": {
      "type": "object",
      "properties": {
        "RepositoryUrl": {
          "type": "string",
          "description": "The location of the repository that contains the source code."
        },
        "SourceCodeVersion": {
          "$ref": "#/$defs/SourceCodeVersion"
        },
        "CodeConfiguration": {
          "$ref": "#/$defs/CodeConfiguration"
        },
        "SourceDirectory": {
          "type": "string",
          "description": "The path of the directory that stores source code and configuration files. The build and start commands also execute from here. The path is absolute from root and, if not specified, defaults to the repository root."
        }
      },
      "required": [
        "RepositoryUrl",
        "SourceCodeVersion"
      ]
    },
    "EgressConfiguration": {
      "type": "object",
      "properties": {
        "EgressType": {
          "type": "string",
          "enum": [
            "DEFAULT",
            "VPC"
          ],
          "description": "The type of egress configuration. Set to DEFAULT for access to resources hosted on public networks. Set to VPC to associate your service to a custom VPC specified by VpcConnectorArn."
        },
        "VpcConnectorArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the App Runner VPC connector that you want to associate with your App Runner service. Only valid when EgressType = VPC."
        }
      }
    },
    "EncryptionConfiguration": {
      "type": "object",
      "properties": {
        "KmsKey": {
          "type": "string",
          "description": "The ARN of the KMS key that's used for encryption."
        }
      },
      "required": [
        "KmsKey"
      ]
    },
    "HealthCheckConfiguration": {
      "type": "object",
      "properties": {
        "Protocol": {
          "type": "string",
          "enum": [
            "TCP",
            "HTTP"
          ],
          "description": "The IP protocol that App Runner uses to perform health checks for your service. If you set Protocol to HTTP, App Runner sends health check requests to the HTTP path specified by Path. Default: TCP"
        },
        "Path": {
          "type": "string",
          "description": "The URL that health check requests are sent to. Path is only applicable when you set Protocol to HTTP. Default: \"/\""
        },
        "Interval": {
          "type": "integer",
          "description": "The time interval, in seconds, between health checks. Default: 5"
        },
        "Timeout": {
          "type": "integer",
          "description": "The time, in seconds, to wait for a health check response before deciding it failed. Default: 2"
        },
        "HealthyThreshold": {
          "type": "integer",
          "description": "The number of consecutive checks that must succeed before App Runner decides that the service is healthy. Default: 1"
        },
        "UnhealthyThreshold": {
          "type": "integer",
          "description": "The number of consecutive checks that must fail before App Runner decides that the service is unhealthy. Default: 5"
        }
      }
    },
    "ImageConfiguration": {
      "type": "object",
      "properties": {
        "RuntimeEnvironmentVariables": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables that are available to your running App Runner service. An array of key-value pairs."
        },
        "StartCommand": {
          "type": "string",
          "description": "An optional command that App Runner runs to start the application in the source image. If specified, this command overrides the Docker image’s default start command."
        },
        "Port": {
          "type": "string",
          "description": "The port that your application listens to in the container. Default: 8080"
        },
        "RuntimeEnvironmentSecrets": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "An array of key-value pairs representing the secrets and parameters that get referenced to your service as an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store. If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services Region as the service that you're launching, you can use either the full ARN or name of the secret. If the parameter exists in a different Region, then the full ARN must"
        }
      }
    },
    "ImageRepository": {
      "type": "object",
      "properties": {
        "ImageIdentifier": {
          "type": "string",
          "description": "The identifier of an image. For an image in Amazon Elastic Container Registry (Amazon ECR), this is an image name. For the image name format, see Pulling an image in the Amazon ECR User Guide."
        },
        "ImageConfiguration": {
          "$ref": "#/$defs/ImageConfiguration"
        },
        "ImageRepositoryType": {
          "type": "string",
          "enum": [
            "ECR",
            "ECR_PUBLIC"
          ],
          "description": "The type of the image repository. This reflects the repository provider and whether the repository is private or public."
        }
      },
      "required": [
        "ImageIdentifier",
        "ImageRepositoryType"
      ]
    },
    "IngressConfiguration": {
      "type": "object",
      "properties": {
        "IsPubliclyAccessible": {
          "type": "boolean",
          "description": "Specifies whether your App Runner service is publicly accessible. To make the service publicly accessible set it to True. To make the service privately accessible, from only within an Amazon VPC set it to False."
        }
      }
    },
    "InstanceConfiguration": {
      "type": "object",
      "properties": {
        "Cpu": {
          "type": "string",
          "description": "The number of CPU units reserved for each instance of your App Runner service. Default: 1 vCPU"
        },
        "Memory": {
          "type": "string",
          "description": "The amount of memory, in MB or GB, reserved for each instance of your App Runner service. Default: 2 GB"
        },
        "InstanceRoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an IAM role that provides permissions to your App Runner service. These are permissions that your code needs when it calls any Amazon Web Services APIs."
        }
      }
    },
    "NetworkConfiguration": {
      "type": "object",
      "properties": {
        "EgressConfiguration": {
          "$ref": "#/$defs/EgressConfiguration"
        },
        "IngressConfiguration": {
          "$ref": "#/$defs/IngressConfiguration"
        },
        "IpAddressType": {
          "type": "string",
          "enum": [
            "IPV4",
            "DUAL_STACK"
          ],
          "description": "App Runner provides you with the option to choose between IPv4 and dual stack (IPv4 and IPv6). This is an optional parameter. If you do not specify an IpAddressType, it defaults to select IPv4."
        }
      }
    },
    "ServiceObservabilityConfiguration": {
      "type": "object",
      "properties": {
        "ObservabilityEnabled": {
          "type": "boolean",
          "description": "When true, an observability configuration resource is associated with the service, and an ObservabilityConfigurationArn is specified."
        },
        "ObservabilityConfigurationArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the observability configuration that is associated with the service. Specified only when ObservabilityEnabled is true. Specify an ARN with a name and a revision number to associate that revision. For example: arn:aws:apprunner:us-east-1:123456789012:observabilityconfiguration/xray-tracing/3 Specify just the name to associate the latest revision. For example: arn:aws:apprunner:us-east-1:123456789012:observabilityconfiguration/xray-tracing"
        }
      },
      "required": [
        "ObservabilityEnabled"
      ]
    },
    "SourceCodeVersion": {
      "type": "object",
      "properties": {
        "Type": {
          "type": "string",
          "enum": [
            "BRANCH"
          ],
          "description": "The type of version identifier. For a git-based repository, branches represent versions."
        },
        "Value": {
          "type": "string",
          "description": "A source code version. For a git-based repository, a branch name maps to a specific version. App Runner uses the most recent commit to the branch."
        }
      },
      "required": [
        "Type",
        "Value"
      ]
    },
    "SourceConfiguration": {
      "type": "object",
      "properties": {
        "CodeRepository": {
          "$ref": "#/$defs/CodeRepository"
        },
        "ImageRepository": {
          "$ref": "#/$defs/ImageRepository"
        },
        "AutoDeploymentsEnabled": {
          "type": "boolean",
          "description": "If true, continuous integration from the source repository is enabled for the App Runner service. Each repository change (including any source code commit or new image version) starts a deployment. Default: App Runner sets to false for a source image that uses an ECR Public repository or an ECR repository that's in an Amazon Web Services account other than the one that the service is in. App Runner sets to true in all other cases (which currently include a source code repository or a source image using a same-account ECR repository)."
        },
        "AuthenticationConfiguration": {
          "$ref": "#/$defs/AuthenticationConfiguration"
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key of the tag."
        },
        "Value": {
          "type": "string",
          "description": "The value of the tag."
        }
      }
    }
  }
}