Skip to content

CreateDeployment

Source: src/AWS/Amplify/CreateDeployment.ts

Runtime binding for amplify:CreateDeployment.

Bind an App in the function’s init phase to get a callable that creates a manual deployment for a branch of an app with no connected repository. The result carries pre-signed upload URLs (zipUploadUrl, or per-file fileUploadUrls when a fileMap of MD5 hashes is supplied); upload the content there, then release it with StartDeployment. Provide the implementation with Effect.provide(AWS.Amplify.CreateDeploymentHttp).

// init — bind the operation to the app
const createDeployment = yield* AWS.Amplify.CreateDeployment(app);
// runtime — obtain the upload URL for the deployment artifact
const { jobId, zipUploadUrl } = yield* createDeployment({
branchName: "main",
});
// PUT the site zip to `zipUploadUrl`, then start the deployment with jobId