Skip to content

update_environment async

update_environment(
    app_name: AppName,
    environment_name: EnvironmentName,
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    environment_role_arn: Optional[EnvironmentRoleArn] = None,
    environment_role_permission_mode: Optional[EnvironmentRolePermissionMode] = None,
    source_config: Optional[EnvironmentUpdateSourceConfigRequest] = None,
    waf_log_configs: Optional[WafLogConfigRequestList] = None,
    gradual_rollout_config: Optional[GradualRolloutConfig] = None,
    web: Optional[EnvironmentUpdateWebConfigRequest] = None,
    backend: Optional[EnvironmentUpdateBackendRequest] = None,
    network_config: Optional[EnvironmentUpdateNetworkConfigRequest] = None,
) -> UpdateEnvironmentResponse

Updates an environment for a Gen 3 app.

Parameters:

Raises:

Source code in docs_src/capo_amplifygen3/_services/async_amplify_gen3.py
async def update_environment(
    self,
    app_name: "capo_amplifygen3.types.app_name.AppName",
    environment_name: "capo_amplifygen3.types.environment_name.EnvironmentName",
    *,
    config_overrides: Optional[AsyncAmplifyGen3ClientConfig] = None,
    environment_role_arn: Optional[
        "capo_amplifygen3.types.environment_role_arn.EnvironmentRoleArn"
    ] = None,
    environment_role_permission_mode: Optional[
        "capo_amplifygen3.types.environment_role_permission_mode.EnvironmentRolePermissionMode"
    ] = None,
    source_config: Optional[
        "capo_amplifygen3.types.environment_update_source_config_request.EnvironmentUpdateSourceConfigRequest"
    ] = None,
    waf_log_configs: Optional[
        "capo_amplifygen3.types.waf_log_config_request_list.WafLogConfigRequestList"
    ] = None,
    gradual_rollout_config: Optional[
        "capo_amplifygen3.types.gradual_rollout_config.GradualRolloutConfig"
    ] = None,
    web: Optional[
        "capo_amplifygen3.types.environment_update_web_config_request.EnvironmentUpdateWebConfigRequest"
    ] = None,
    backend: Optional[
        "capo_amplifygen3.types.environment_update_backend_request.EnvironmentUpdateBackendRequest"
    ] = None,
    network_config: Optional[
        "capo_amplifygen3.types.environment_update_network_config_request.EnvironmentUpdateNetworkConfigRequest"
    ] = None,
) -> "capo_amplifygen3.types.update_environment_response.UpdateEnvironmentResponse":
    """<p>Updates an environment for a Gen 3 app.</p>

    Args:
        app_name: <p>The name of the app.</p>
        environment_name: <p>The name of the environment.</p>
        environment_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
        environment_role_permission_mode: <p>The permission mode for the environment's IAM role.</p>
        source_config: <p>The source configuration for the environment.</p>
        waf_log_configs: <p>A list of the environment's AWS WAF log configurations.</p>
        gradual_rollout_config: <p>The gradual rollout settings.</p>
        web: <p>The web hosting settings for the environment.</p>
        backend: <p>The backend settings for the environment. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.</p>
        network_config: <p>The VPC network configuration for the environment.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifygen3.types.update_environment_request.UpdateEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifygen3.types.update_environment_response.UpdateEnvironmentResponse"
    ]:
        import capo_amplifygen3._operations.omega.update_environment

        (
            output,
            http_response,
        ) = await capo_amplifygen3._operations.omega.update_environment.async_update_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEnvironment")
    )
    input_: capo_amplifygen3.types.update_environment_request.UpdateEnvironmentRequest = {
        "app_name": app_name,
        "environment_name": environment_name,
    }
    if environment_role_arn is not None:
        input_["environment_role_arn"] = environment_role_arn
    if environment_role_permission_mode is not None:
        input_["environment_role_permission_mode"] = (
            environment_role_permission_mode
        )
    if source_config is not None:
        input_["source_config"] = source_config
    if waf_log_configs is not None:
        input_["waf_log_configs"] = waf_log_configs
    if gradual_rollout_config is not None:
        input_["gradual_rollout_config"] = gradual_rollout_config
    if web is not None:
        input_["web"] = web
    if backend is not None:
        input_["backend"] = backend
    if network_config is not None:
        input_["network_config"] = network_config

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