Skip to content

tag_resource

tag_resource(
    resource_arn: EnvironmentArn,
    tags: TagMap,
    *,
    config_overrides: Optional[MWAAClientConfig] = None,
) -> TagResourceOutput

Associates key-value tag pairs to your Amazon Managed Workflows for Apache Airflow (MWAA) environment.

Parameters:

  • resource_arn (EnvironmentArn) –

    The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment.

  • tags (TagMap) –

    The key-value tag pairs you want to associate to your environment. For example, "Environment": "Staging". For more information, refer to Tagging Amazon Web Services resources.

Raises:

Source code in docs_src/capo_mwaa/_services/mwaa.py
def tag_resource(
    self,
    resource_arn: "capo_mwaa.types.environment_arn.EnvironmentArn",
    tags: "capo_mwaa.types.tag_map.TagMap",
    *,
    config_overrides: Optional[MWAAClientConfig] = None,
) -> "capo_mwaa.types.tag_resource_output.TagResourceOutput":
    """<p>Associates key-value tag pairs to your Amazon Managed Workflows for Apache Airflow (MWAA) environment. </p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, <code>arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment</code>.</p>
        tags: <p>The key-value tag pairs you want to associate to your environment. For example, <code>"Environment": "Staging"</code>. For more information, refer to <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</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.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse["capo_mwaa.types.tag_resource_output.TagResourceOutput"]:
        import capo_mwaa._operations.amazon_mwaa.tag_resource

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_mwaa.types.tag_resource_input.TagResourceInput = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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