Skip to content

create_connector async

create_connector(
    connector_configuration: ConnectorConfiguration,
    role_arn: RoleArn,
    name: ConnectorName,
    *,
    config_overrides: Optional[AsyncObservabilityAdminClientConfig] = None,
    tags: Optional[TagMapInput] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateConnectorOutput

Creates a connector to a third-party cloud provider. With a connector, you can discover resources in the provider and collect their telemetry. Currently, Microsoft Azure is the only supported provider.

Parameters:

  • connector_configuration (ConnectorConfiguration) –

    The configuration for connecting to the third-party cloud provider.

  • role_arn (RoleArn) –

    The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) role that CloudWatch assumes to get credentials for the third-party cloud provider. The role must trust the Amazon CloudWatch Observability Admin service principal, observabilityadmin.amazonaws.com. The role must also allow sts:GetWebIdentityToken for the provider's token exchange audience.

  • name (ConnectorName) –

    The name of the connector. The name must be unique in the account and Region (case-sensitive). If another connector already uses the name, the request fails with a ConflictException.

    The name can contain letters, digits, hyphens (-), underscores (_) and periods (.), and must start with a letter.

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

    The tags that you want to apply to the connector.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the operation completes no more than one time. If you use an Amazon Web Services SDK, the SDK generates this value and reuses it on retries. If this token matches a previous request with the same parameters, the service returns the connector from the first request without an error. If you use the same token with different parameters, including different tags, the service returns a ValidationException. This operation is idempotent when you use the same token and parameters.

Raises:

Source code in docs_src/capo_observabilityadmin/_services/async_observability_admin.py
async def create_connector(
    self,
    connector_configuration: "capo_observabilityadmin.types.connector_configuration.ConnectorConfiguration",
    role_arn: "capo_observabilityadmin.types.role_arn.RoleArn",
    name: "capo_observabilityadmin.types.connector_name.ConnectorName",
    *,
    config_overrides: Optional[AsyncObservabilityAdminClientConfig] = None,
    tags: Optional[
        "capo_observabilityadmin.types.tag_map_input.TagMapInput"
    ] = None,
    client_token: Optional[
        "capo_observabilityadmin.types.client_token.ClientToken"
    ] = None,
) -> "capo_observabilityadmin.types.create_connector_output.CreateConnectorOutput":
    """<p>Creates a connector to a third-party cloud provider. With a connector, you can discover resources in the provider and collect their telemetry. Currently, Microsoft Azure is the only supported provider.</p>

    Args:
        connector_configuration: <p>The configuration for connecting to the third-party cloud provider.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of the Amazon Web Services Identity and Access Management (IAM) role that CloudWatch assumes to get credentials for the third-party cloud provider. The role must trust the Amazon CloudWatch Observability Admin service principal, <code>observabilityadmin.amazonaws.com</code>. The role must also allow <code>sts:GetWebIdentityToken</code> for the provider's token exchange audience.</p>
        name: <p>The name of the connector. The name must be unique in the account and Region (case-sensitive). If another connector already uses the name, the request fails with a <code>ConflictException</code>.</p> <p>The name can contain letters, digits, hyphens (-), underscores (_) and periods (.), and must start with a letter.</p>
        tags: <p>The tags that you want to apply to the connector.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the operation completes no more than one time. If you use an Amazon Web Services SDK, the SDK generates this value and reuses it on retries. If this token matches a previous request with the same parameters, the service returns the connector from the first request without an error. If you use the same token with different parameters, including different tags, the service returns a <code>ValidationException</code>. This operation is idempotent when you use the same token and parameters.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_observabilityadmin.types.create_connector_input.CreateConnectorInput]",
    ) -> AsyncOperationResponse[
        "capo_observabilityadmin.types.create_connector_output.CreateConnectorOutput"
    ]:
        import capo_observabilityadmin._operations.observability_admin.create_connector

        (
            output,
            http_response,
        ) = await capo_observabilityadmin._operations.observability_admin.create_connector.async_create_connector(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_observabilityadmin.types.create_connector_input.CreateConnectorInput",
    ) -> dict[str, Any]:
        import capo_observabilityadmin.types.create_connector_input

        return (
            capo_observabilityadmin.types.create_connector_input.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateConnector", redact_input=_redact_input),
    )
    input_: capo_observabilityadmin.types.create_connector_input.CreateConnectorInput = {
        "connector_configuration": connector_configuration,
        "role_arn": role_arn,
        "name": name,
    }
    if tags is not None:
        input_["tags"] = tags
    if client_token is not None:
        input_["client_token"] = client_token

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