Skip to content

create_subscriber

create_subscriber(
    subscriber_identity: AwsIdentity,
    subscriber_name: str,
    sources: LogSourceResourceList,
    *,
    config_overrides: Optional[SecurityLakeClientConfig] = None,
    subscriber_description: Optional[DescriptionString] = None,
    access_types: Optional[AccessTypeList] = None,
    tags: Optional[TagList] = None,
) -> CreateSubscriberResponse

Creates a subscriber for accounts that are already enabled in Amazon Security Lake. You can create a subscriber with access to data in the current Amazon Web Services Region.

Parameters:

  • subscriber_identity (AwsIdentity) –

    The Amazon Web Services identity used to access your data.

  • subscriber_name (str) –

    The name of your Security Lake subscriber account.

  • subscriber_description (Optional[DescriptionString], default: None ) –

    The description for your subscriber account in Security Lake.

  • sources (LogSourceResourceList) –

    The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.

  • access_types (Optional[AccessTypeList], default: None ) –

    The Amazon S3 or Lake Formation access type.

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

    An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. Access denied errors appear when Amazon Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs when there is no applicable Deny statement and also no applicable Allow statement.

  • BadRequestException –

    The request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

  • ConflictException –

    Occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.

  • InternalServerException –

    Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting, perform the operation again.

  • ResourceNotFoundException –

    The resource could not be found.

  • ThrottlingException –

    The limit on the number of requests per second was exceeded.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_securitylake/_services/security_lake.py
def create_subscriber(
    self,
    subscriber_identity: "capo_securitylake.types.aws_identity.AwsIdentity",
    subscriber_name: str,
    sources: "capo_securitylake.types.log_source_resource_list.LogSourceResourceList",
    *,
    config_overrides: Optional[SecurityLakeClientConfig] = None,
    subscriber_description: Optional[
        "capo_securitylake.types.description_string.DescriptionString"
    ] = None,
    access_types: Optional[
        "capo_securitylake.types.access_type_list.AccessTypeList"
    ] = None,
    tags: Optional["capo_securitylake.types.tag_list.TagList"] = None,
) -> "capo_securitylake.types.create_subscriber_response.CreateSubscriberResponse":
    """<p>Creates a subscriber for accounts that are already enabled in Amazon Security Lake. You can create a subscriber with access to data in the current Amazon Web Services Region.</p>

    Args:
        subscriber_identity: <p>The Amazon Web Services identity used to access your data.</p>
        subscriber_name: <p>The name of your Security Lake subscriber account.</p>
        subscriber_description: <p>The description for your subscriber account in Security Lake.</p>
        sources: <p>The supported Amazon Web Services services from which logs and events are collected. Security Lake supports log and event collection for natively supported Amazon Web Services services.</p>
        access_types: <p>The Amazon S3 or Lake Formation access type.</p>
        tags: <p>An array of objects, one for each tag to associate with the subscriber. For each tag, you must specify both a tag key and a tag value. A tag value cannot be null, but it can be an empty string.</p>

    Raises:
        capo_securitylake.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. Access denied errors appear when Amazon Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs when there is no applicable Deny statement and also no applicable Allow statement.</p>
        capo_securitylake.errors.bad_request_exception.BadRequestException: <p>The request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
        capo_securitylake.errors.conflict_exception.ConflictException: <p>Occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_securitylake.errors.internal_server_exception.InternalServerException: <p>Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting, perform the operation again.</p>
        capo_securitylake.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_securitylake.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_securitylake.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_securitylake.types.create_subscriber_request.CreateSubscriberRequest]",
    ) -> OperationResponse[
        "capo_securitylake.types.create_subscriber_response.CreateSubscriberResponse"
    ]:
        import capo_securitylake._operations.security_lake.create_subscriber

        output, http_response = (
            capo_securitylake._operations.security_lake.create_subscriber.create_subscriber(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSubscriber")
    )
    input_: capo_securitylake.types.create_subscriber_request.CreateSubscriberRequest = {
        "subscriber_identity": subscriber_identity,
        "subscriber_name": subscriber_name,
        "sources": sources,
    }
    if subscriber_description is not None:
        input_["subscriber_description"] = subscriber_description
    if access_types is not None:
        input_["access_types"] = access_types
    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