POST /builds Build Product
buildProduct
Build a deployable artifact for a product. The artifact must be provided via a URL. A callback will be sent to the URL specified in callback_url property.
Build Hash
The builder generates a unique hash value for each build. This value is available in build metadata which can be accessed using the product information endpoint. Also, this value passes by a Deployer if the AWS CloudFormation parameter definition exists in product serverless.yml. This parameter can be referenced as an environment variable as follows.
Show the rest
callback_url property. Build Hashserverless.yml. This parameter can be referenced as an environment variable as follows.Product serverless.yml:
provider:
environment:
BUILD_HASH:
Ref: BuildHash
...
resources:
Parameters:
BuildHash:
Type: String
Description: This info will be generated by the Builder and passed by Deployer. It contains a product build hash.
Default: "null"
architecture
By default, X86_64 architecture is used to build dependencies. Switch to ARM64 using the 64-bit ARM architecture for the AWS Graviton2 processor. It is possible to use only one architecture per build.
node_version
You can configure Node version to use to package your dependencies.
Please note, that node_version = 14 works only with architecture = X86_64 and compute_instance_size = SMALL.
node_version 18 and 20 works only with architecture = ARM64 and compute_instance_size = SMALL.
compute_instance_size
You can configure how much memory and disk space your build can take up. compute_instance_size is dependent on architecture.
The following table describes mapping of allowed architectures to compute instance sizes.
| Architecture | Compute instance size | Memory | Disk space | vCPUs |
|---|---|---|---|---|
| ARM64 | SMALL | 4 GB | 50 GB | 2 |
| ARM64 | LARGE | 16 GB | 50 GB | 8 |
| X86_64 | SMALL | 3 GB | 64 GB | 2 |
Request
{
"source_url": "https://code-manager-dev-root.s3.amazonaws.com/service-builder-api/2f867413-2f16-4c73-86ec-3086c0d4a33c/source.zip"
} Response
Build created
{
"build_id": "13bd5b51-1a41-4510-9baa-d7f7e24c89a3"
} Request data failed validation
{
"message": "{'data': ['Missing data for required field.']}"
} Request bodyapplication/json
8 fields
application/json| Field | Type | Description |
|---|---|---|
bundle_id | string (uuid) | Usually a hash of the commit but can be any UUID. |
source_urlrequired | string (uri) | Presigned URL to source code. |
callback_url | string (uri) | Callback URL where are you waiting for build status |
serverless_version | string | Serverless version, that is used in build process to update serverless framework version.2.x3.xExample 3.x |
log_level | string | Log level, that is used in build process. Can be used with \"DEBUG\" value for Build product debugging.DEBUGINFOExample INFO |
architecture | string | Architecture used to build your bundle dependencies.ARM64X86_64Example X86_64 |
node_version | string | Node version used to package your dependencies. 14 version works only with X86_64, small instance.12141820Example 12 |
compute_instance_size | string | Compute instance size defines the computational instance used during the build.LARGESMALLExample SMALL |
Response 201application/json
1 fields
201application/jsonBuild created
| Field | Type | Description |
|---|---|---|
build_id | string (uuid) | Unique build_id which can be used for tracking build status. Usually it is a UUID. |
Response 400application/json
1 fields
400application/jsonRequest data failed validation
| Field | Type | Description |
|---|---|---|
message | one of | Error message in string or object format |
Response 403application/json
2 fields
403application/jsonForbidden
| Field | Type | Description |
|---|---|---|
message | string | Error message in string format |
url | string (url) | URL with link to page with information how this issue can be resolved |