{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-greengrass/json-schema/amazon-iot-greengrass-create-component-version-request-schema.json",
  "title": "CreateComponentVersionRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-greengrass-greengrass-api-openapi.yml#/components/schemas/CreateComponentVersionRequest",
  "type": "object",
  "properties": {
    "inlineRecipe": {
      "type": "string",
      "format": "byte",
      "description": "The recipe to use to create the component. The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility. You must specify either inlineRecipe or lambdaFunction."
    },
    "lambdaFunction": {
      "$ref": "#/$defs/LambdaFunctionRecipeSource"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours."
    }
  },
  "$defs": {
    "ComponentDependencyRequirement": {
      "type": "object",
      "properties": {
        "versionRequirement": {
          "type": "string",
          "description": "The component version requirement for the component dependency. IoT Greengrass V2 uses semantic version constraints. For more information, see Semantic Versioning."
        },
        "dependencyType": {
          "type": "string",
          "enum": [
            "HARD",
            "SOFT"
          ],
          "description": "The type of this dependency. Choose from the following options: SOFT – The component doesn't restart if the dependency changes state. HARD – The component restarts if the dependency changes state. Default: HARD"
        }
      }
    },
    "ComponentPlatform": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The friendly name of the platform. This name helps you identify the platform. If you omit this parameter, IoT Greengrass creates a friendly name from the os and architecture of the platform."
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A dictionary of attributes for the platform. The IoT Greengrass Core software defines the os and architecture by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the Greengrass nucleus component in the IoT Greengrass V2 Developer Guide."
        }
      }
    },
    "LambdaContainerParams": {
      "type": "object",
      "properties": {
        "memorySizeInKB": {
          "type": "integer",
          "description": "The memory size of the container, expressed in kilobytes. Default: 16384 (16 MB)"
        },
        "mountROSysfs": {
          "type": "boolean",
          "description": "Whether or not the container can read information from the device's /sys folder. Default: false"
        },
        "volumes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LambdaVolumeMount"
          },
          "description": "The list of volumes that the container can access."
        },
        "devices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LambdaDeviceMount"
          },
          "description": "The list of system devices that the container can access."
        }
      }
    },
    "LambdaDeviceMount": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "The mount path for the device in the file system."
        },
        "permission": {
          "type": "string",
          "enum": [
            "ro",
            "rw"
          ],
          "description": "The permission to access the device: read/only (ro) or read/write (rw). Default: ro"
        },
        "addGroupOwner": {
          "type": "boolean",
          "description": "Whether or not to add the component's system user as an owner of the device. Default: false"
        }
      },
      "required": [
        "path"
      ]
    },
    "LambdaEventSource": {
      "type": "object",
      "properties": {
        "topic": {
          "type": "string",
          "description": "The topic to which to subscribe to receive event messages."
        },
        "type": {
          "type": "string",
          "enum": [
            "PUB_SUB",
            "IOT_CORE"
          ],
          "description": "The type of event source. Choose from the following options: PUB_SUB – Subscribe to local publish/subscribe messages. This event source type doesn't support MQTT wildcards (+ and #) in the event source topic. IOT_CORE – Subscribe to Amazon Web Services IoT Core MQTT messages. This event source type supports MQTT wildcards (+ and #) in the event source topic."
        }
      },
      "required": [
        "topic",
        "type"
      ]
    },
    "LambdaExecutionParameters": {
      "type": "object",
      "properties": {
        "eventSources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LambdaEventSource"
          },
          "description": "The list of event sources to which to subscribe to receive work messages. The Lambda function runs when it receives a message from an event source. You can subscribe this function to local publish/subscribe messages and Amazon Web Services IoT Core MQTT messages."
        },
        "maxQueueSize": {
          "type": "integer",
          "description": "The maximum size of the message queue for the Lambda function component. The IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until it can run the Lambda function to consume each message."
        },
        "maxInstancesCount": {
          "type": "integer",
          "description": "The maximum number of instances that a non-pinned Lambda function can run at the same time."
        },
        "maxIdleTimeInSeconds": {
          "type": "integer",
          "description": "The maximum amount of time in seconds that a non-pinned Lambda function can idle before the IoT Greengrass Core software stops its process."
        },
        "timeoutInSeconds": {
          "type": "integer",
          "description": "The maximum amount of time in seconds that the Lambda function can process a work item."
        },
        "statusTimeoutInSeconds": {
          "type": "integer",
          "description": "The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component."
        },
        "pinned": {
          "type": "boolean",
          "description": "Whether or not the Lambda function is pinned, or long-lived. A pinned Lambda function starts when IoT Greengrass starts and keeps running in its own container. A non-pinned Lambda function starts only when it receives a work item and exists after it idles for maxIdleTimeInSeconds. If the function has multiple work items, the IoT Greengrass Core software creates multiple instances of the function. Default: true"
        },
        "inputPayloadEncodingType": {
          "type": "string",
          "enum": [
            "json",
            "binary"
          ],
          "description": "The encoding type that the Lambda function supports. Default: json"
        },
        "execArgs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of arguments to pass to the Lambda function when it runs."
        },
        "environmentVariables": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The map of environment variables that are available to the Lambda function when it runs."
        },
        "linuxProcessParams": {
          "$ref": "#/$defs/LambdaLinuxProcessParams"
        }
      }
    },
    "LambdaFunctionRecipeSource": {
      "type": "object",
      "properties": {
        "lambdaArn": {
          "type": "string",
          "description": "The ARN of the Lambda function. The ARN must include the version of the function to import. You can't use version aliases like $LATEST."
        },
        "componentName": {
          "type": "string",
          "description": "The name of the component. Defaults to the name of the Lambda function."
        },
        "componentVersion": {
          "type": "string",
          "description": "The version of the component. Defaults to the version of the Lambda function as a semantic version. For example, if your function version is 3, the component version becomes 3.0.0."
        },
        "componentPlatforms": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ComponentPlatform"
          },
          "description": "The platforms that the component version supports."
        },
        "componentDependencies": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ComponentDependencyRequirement"
          },
          "description": "The component versions on which this Lambda function component depends."
        },
        "componentLambdaParameters": {
          "$ref": "#/$defs/LambdaExecutionParameters"
        }
      },
      "required": [
        "lambdaArn"
      ]
    },
    "LambdaLinuxProcessParams": {
      "type": "object",
      "properties": {
        "isolationMode": {
          "type": "string",
          "enum": [
            "GreengrassContainer",
            "NoContainer"
          ],
          "description": "The isolation mode for the process that contains the Lambda function. The process can run in an isolated runtime environment inside the IoT Greengrass container, or as a regular process outside any container. Default: GreengrassContainer"
        },
        "containerParams": {
          "$ref": "#/$defs/LambdaContainerParams"
        }
      }
    },
    "LambdaVolumeMount": {
      "type": "object",
      "properties": {
        "sourcePath": {
          "type": "string",
          "description": "The path to the physical volume in the file system."
        },
        "destinationPath": {
          "type": "string",
          "description": "The path to the logical volume in the file system."
        },
        "permission": {
          "type": "string",
          "enum": [
            "ro",
            "rw"
          ],
          "description": "The permission to access the volume: read/only (ro) or read/write (rw). Default: ro"
        },
        "addGroupOwner": {
          "type": "boolean",
          "description": "Whether or not to add the IoT Greengrass user group as an owner of the volume. Default: false"
        }
      },
      "required": [
        "sourcePath",
        "destinationPath"
      ]
    }
  }
}