Skip to content

update_app

update_app(
    app_name: AppName,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    source_config: Optional[AppUpdateSourceConfigRequest] = None,
    web: Optional[AppUpdateWebConfigRequest] = None,
    backend: Optional[AppBackendRequest] = None,
) -> UpdateAppResponse

Updates a Gen 3 app.

Parameters:

  • app_name (AppName) –

    The name of the app.

  • source_config (Optional[AppUpdateSourceConfigRequest], default: None ) –

    The source configuration for the app.

  • web (Optional[AppUpdateWebConfigRequest], default: None ) –

    The web hosting settings for the app.

  • backend (Optional[AppBackendRequest], default: None ) –

    The backend settings for the app. Specify this to add a backend to an app that doesn't have one. For an app that already has a backend, you can change only the migrations directory. Omit this to leave the backend unchanged.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def update_app(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    source_config: Optional[
        "capo_amplifygen3.types.app_update_source_config_request.AppUpdateSourceConfigRequest"
    ] = None,
    web: Optional[
        "capo_amplifygen3.types.app_update_web_config_request.AppUpdateWebConfigRequest"
    ] = None,
    backend: Optional[
        "capo_amplifygen3.types.app_backend_request.AppBackendRequest"
    ] = None,
) -> "capo_amplifygen3.types.update_app_response.UpdateAppResponse":
    """<p>Updates a Gen 3 app.</p>

    Args:
        app_name: <p>The name of the app.</p>
        source_config: <p>The source configuration for the app.</p>
        web: <p>The web hosting settings for the app.</p>
        backend: <p>The backend settings for the app. Specify this to add a backend to an app that doesn't have one. For an app that already has a backend, you can change only the migrations directory. Omit this to leave the backend unchanged.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota for your account.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.update_app_request.UpdateAppRequest]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.update_app_response.UpdateAppResponse"
    ]:
        import capo_amplifygen3._operations.omega.update_app

        output, http_response = (
            capo_amplifygen3._operations.omega.update_app.update_app(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateApp")
    )
    input_: capo_amplifygen3.types.update_app_request.UpdateAppRequest = {
        "app_name": app_name
    }
    if source_config is not None:
        input_["source_config"] = source_config
    if web is not None:
        input_["web"] = web
    if backend is not None:
        input_["backend"] = backend

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