Skip to content

create_deployment async

create_deployment(
    app_id: AppId,
    branch_name: BranchName,
    *,
    config_overrides: Optional[AsyncAmplifyClientConfig] = None,
    file_map: Optional[FileMap] = None,
) -> CreateDeploymentResult

Creates a deployment for a manually deployed Amplify app. Manually deployed apps are not connected to a Git repository.

The maximum duration between the CreateDeployment call and the StartDeployment call cannot exceed 8 hours. If the duration exceeds 8 hours, the StartDeployment call and the associated Job will fail.

Parameters:

  • app_id (AppId) –

    The unique ID for an Amplify app.

  • branch_name (BranchName) –

    The name of the branch to use for the job.

  • file_map (Optional[FileMap], default: None ) –

    An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files.

Raises:

Source code in docs_src/capo_amplify/_services/async_amplify.py
async def create_deployment(
    self,
    app_id: "capo_amplify.types.app_id.AppId",
    branch_name: "capo_amplify.types.branch_name.BranchName",
    *,
    config_overrides: Optional[AsyncAmplifyClientConfig] = None,
    file_map: Optional["capo_amplify.types.file_map.FileMap"] = None,
) -> "capo_amplify.types.create_deployment_result.CreateDeploymentResult":
    """<p>Creates a deployment for a manually deployed Amplify app. Manually deployed apps are not connected to a Git repository. </p> <p>The maximum duration between the <code>CreateDeployment</code> call and the <code>StartDeployment</code> call cannot exceed 8 hours. If the duration exceeds 8 hours, the <code>StartDeployment</code> call and the associated <code>Job</code> will fail.</p>

    Args:
        app_id: <p> The unique ID for an Amplify app. </p>
        branch_name: <p> The name of the branch to use for the job. </p>
        file_map: <p> An optional file map that contains the file name as the key and the file content md5 hash as the value. If this argument is provided, the service will generate a unique upload URL per file. Otherwise, the service will only generate a single upload URL for the zipped files. </p>

    Raises:
        capo_amplify.errors.bad_request_exception.BadRequestException: <p>A request contains unexpected data. </p>
        capo_amplify.errors.internal_failure_exception.InternalFailureException: <p>The service failed to perform an operation due to an internal issue. </p>
        capo_amplify.errors.limit_exceeded_exception.LimitExceededException: <p>A resource could not be created because service quotas were exceeded. </p>
        capo_amplify.errors.unauthorized_exception.UnauthorizedException: <p>An operation failed due to a lack of access. </p>
        capo_amplify.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplify.types.create_deployment_request.CreateDeploymentRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplify.types.create_deployment_result.CreateDeploymentResult"
    ]:
        import capo_amplify._operations.amplify.create_deployment

        (
            output,
            http_response,
        ) = await capo_amplify._operations.amplify.create_deployment.async_create_deployment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDeployment")
    )
    input_: capo_amplify.types.create_deployment_request.CreateDeploymentRequest = {
        "app_id": app_id,
        "branch_name": branch_name,
    }
    if file_map is not None:
        input_["file_map"] = file_map

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output