Skip to content

create_telemetry_rule_for_organization

create_telemetry_rule_for_organization(
    rule_name: RuleName,
    rule: TelemetryRule,
    *,
    config_overrides: Optional[ObservabilityAdminClientConfig] = None,
    tags: Optional[TagMapInput] = None,
) -> CreateTelemetryRuleForOrganizationOutput

Creates a telemetry rule that applies across an Amazon Web Services Organization. This operation can only be called by the organization's management account or a delegated administrator account.

Parameters:

  • rule_name (RuleName) –

    A unique name for the organization-wide telemetry rule being created.

  • rule (TelemetryRule) –

    The configuration details for the organization-wide telemetry rule, including the resource type, telemetry type, destination configuration, and selection criteria for which resources the rule applies to across the organization.

  • tags (Optional[TagMapInput], default: None ) –

    The key-value pairs to associate with the organization telemetry rule resource for categorization and management purposes.

Raises:

Source code in docs_src/capo_observabilityadmin/_services/observability_admin.py
def create_telemetry_rule_for_organization(
    self,
    rule_name: "capo_observabilityadmin.types.rule_name.RuleName",
    rule: "capo_observabilityadmin.types.telemetry_rule.TelemetryRule",
    *,
    config_overrides: Optional[ObservabilityAdminClientConfig] = None,
    tags: Optional[
        "capo_observabilityadmin.types.tag_map_input.TagMapInput"
    ] = None,
) -> "capo_observabilityadmin.types.create_telemetry_rule_for_organization_output.CreateTelemetryRuleForOrganizationOutput":
    """<p> Creates a telemetry rule that applies across an Amazon Web Services Organization. This operation can only be called by the organization's management account or a delegated administrator account. </p>

    Args:
        rule_name: <p> A unique name for the organization-wide telemetry rule being created. </p>
        rule: <p> The configuration details for the organization-wide telemetry rule, including the resource type, telemetry type, destination configuration, and selection criteria for which resources the rule applies to across the organization. </p>
        tags: <p> The key-value pairs to associate with the organization telemetry rule resource for categorization and management purposes. </p>

    Raises:
        capo_observabilityadmin.errors.access_denied_exception.AccessDeniedException: <p> Indicates you don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html">Access management for Amazon Web Services resources</a> in the IAM user guide. </p>
        capo_observabilityadmin.errors.conflict_exception.ConflictException: <p> The requested operation conflicts with the current state of the specified resource or with another request. </p>
        capo_observabilityadmin.errors.internal_server_exception.InternalServerException: <p> Indicates the request has failed to process because of an unknown server error, exception, or failure. </p>
        capo_observabilityadmin.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The requested operation would exceed the allowed quota for the specified resource type. </p>
        capo_observabilityadmin.errors.too_many_requests_exception.TooManyRequestsException: <p> The request throughput limit was exceeded. </p>
        capo_observabilityadmin.errors.validation_exception.ValidationException: <p> Indicates input validation failed. Check your request parameters and retry the request. </p>
        capo_observabilityadmin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_observabilityadmin.types.create_telemetry_rule_for_organization_input.CreateTelemetryRuleForOrganizationInput]",
    ) -> OperationResponse[
        "capo_observabilityadmin.types.create_telemetry_rule_for_organization_output.CreateTelemetryRuleForOrganizationOutput"
    ]:
        import capo_observabilityadmin._operations.observability_admin.create_telemetry_rule_for_organization

        output, http_response = (
            capo_observabilityadmin._operations.observability_admin.create_telemetry_rule_for_organization.create_telemetry_rule_for_organization(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTelemetryRuleForOrganization")
    )
    input_: capo_observabilityadmin.types.create_telemetry_rule_for_organization_input.CreateTelemetryRuleForOrganizationInput = {
        "rule_name": rule_name,
        "rule": rule,
    }
    if tags is not None:
        input_["tags"] = tags

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