Skip to content

start_deployment

start_deployment(
    app_id: AppId,
    branch_name: BranchName,
    *,
    config_overrides: Optional[AmplifyClientConfig] = None,
    job_id: Optional[JobId] = None,
    source_url: Optional[SourceUrl] = None,
    source_url_type: Optional[SourceUrlType] = None,
) -> StartDeploymentResult

Starts a deployment for a manually deployed 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 deployment job.

  • job_id (Optional[JobId], default: None ) –

    The job ID for this deployment that is generated by the CreateDeployment request.

  • source_url (Optional[SourceUrl], default: None ) –

    The source URL for the deployment that is used when calling StartDeployment without CreateDeployment. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.

  • source_url_type (Optional[SourceUrlType], default: None ) –

    The type of source specified by the sourceURL. If the value is ZIP, the source is a .zip file. If the value is BUCKET_PREFIX, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is ZIP.

Raises:

Source code in docs_src/capo_amplify/_services/amplify.py
def start_deployment(
    self,
    app_id: "capo_amplify.types.app_id.AppId",
    branch_name: "capo_amplify.types.branch_name.BranchName",
    *,
    config_overrides: Optional[AmplifyClientConfig] = None,
    job_id: Optional["capo_amplify.types.job_id.JobId"] = None,
    source_url: Optional["capo_amplify.types.source_url.SourceUrl"] = None,
    source_url_type: Optional[
        "capo_amplify.types.source_url_type.SourceUrlType"
    ] = None,
) -> "capo_amplify.types.start_deployment_result.StartDeploymentResult":
    """<p>Starts a deployment for a manually deployed 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 deployment job. </p>
        job_id: <p>The job ID for this deployment that is generated by the <code>CreateDeployment</code> request. </p>
        source_url: <p>The source URL for the deployment that is used when calling <code>StartDeployment</code> without <code>CreateDeployment</code>. The source URL can be either an HTTP GET URL that is publicly accessible and downloads a single .zip file, or an Amazon S3 bucket and prefix.</p>
        source_url_type: <p>The type of source specified by the <code>sourceURL</code>. If the value is <code>ZIP</code>, the source is a .zip file. If the value is <code>BUCKET_PREFIX</code>, the source is an Amazon S3 bucket and prefix. If no value is specified, the default is <code>ZIP</code>.</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.not_found_exception.NotFoundException: <p>An entity was not found during an operation. </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.
    """

    def _handler(
        req: "OperationRequest[capo_amplify.types.start_deployment_request.StartDeploymentRequest]",
    ) -> OperationResponse[
        "capo_amplify.types.start_deployment_result.StartDeploymentResult"
    ]:
        import capo_amplify._operations.amplify.start_deployment

        output, http_response = (
            capo_amplify._operations.amplify.start_deployment.start_deployment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartDeployment")
    )
    input_: capo_amplify.types.start_deployment_request.StartDeploymentRequest = {
        "app_id": app_id,
        "branch_name": branch_name,
    }
    if job_id is not None:
        input_["job_id"] = job_id
    if source_url is not None:
        input_["source_url"] = source_url
    if source_url_type is not None:
        input_["source_url_type"] = source_url_type

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output