Skip to content

get_environment

get_environment(
    name: EnvironmentName, *, config_overrides: Optional[MWAAClientConfig] = None
) -> GetEnvironmentOutput

Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.

Parameters:

  • name (EnvironmentName) –

    The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.

Raises:

Source code in docs_src/capo_mwaa/_services/mwaa.py
def get_environment(
    self,
    name: "capo_mwaa.types.environment_name.EnvironmentName",
    *,
    config_overrides: Optional[MWAAClientConfig] = None,
) -> "capo_mwaa.types.get_environment_output.GetEnvironmentOutput":
    """<p>Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.</p>

    Args:
        name: <p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>

    Raises:
        capo_mwaa.errors.internal_server_exception.InternalServerException: <p>InternalServerException: An internal error has occurred.</p>
        capo_mwaa.errors.resource_not_found_exception.ResourceNotFoundException: <p>ResourceNotFoundException: The resource is not available.</p>
        capo_mwaa.errors.validation_exception.ValidationException: <p>ValidationException: The provided input is not valid.</p>
        capo_mwaa.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mwaa.types.get_environment_input.GetEnvironmentInput]",
    ) -> OperationResponse[
        "capo_mwaa.types.get_environment_output.GetEnvironmentOutput"
    ]:
        import capo_mwaa._operations.amazon_mwaa.get_environment

        output, http_response = (
            capo_mwaa._operations.amazon_mwaa.get_environment.get_environment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_mwaa.types.get_environment_output.GetEnvironmentOutput",
    ) -> dict[str, Any]:
        import capo_mwaa.types.get_environment_output

        return capo_mwaa.types.get_environment_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetEnvironment", redact_output=_redact_output),
    )
    input_: capo_mwaa.types.get_environment_input.GetEnvironmentInput = {
        "name": name
    }

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