Skip to content

create_member

create_member(
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    account: Optional[AccountDetail] = None,
    tags: Optional[TagMap] = None,
) -> CreateMemberResponse

Associates an account with an Amazon Macie administrator account.

Parameters:

  • account (Optional[AccountDetail], default: None ) –

    The details of the account to associate with the administrator account.

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

    A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.

    An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.

Raises:

  • AccessDeniedException –

    Provides information about an error that occurred due to insufficient access to a specified resource.

  • ConflictException –

    Provides information about an error that occurred due to a versioning conflict for a specified resource.

  • InternalServerException –

    Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

  • ResourceNotFoundException –

    Provides information about an error that occurred because a specified resource wasn't found.

  • ServiceQuotaExceededException –

    Provides information about an error that occurred due to one or more service quotas for an account.

  • ThrottlingException –

    Provides information about an error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    Provides information about an error that occurred due to a syntax error in a request.

  • UnknownServiceError –

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

Source code in docs_src/capo_macie2/_services/macie2.py
def create_member(
    self,
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    account: Optional["capo_macie2.types.account_detail.AccountDetail"] = None,
    tags: Optional["capo_macie2.types.tag_map.TagMap"] = None,
) -> "capo_macie2.types.create_member_response.CreateMemberResponse":
    """<p>Associates an account with an Amazon Macie administrator account.</p>

    Args:
        account: <p>The details of the account to associate with the administrator account.</p>
        tags: <p>A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.</p> <p>An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>

    Raises:
        capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
        capo_macie2.errors.conflict_exception.ConflictException: <p>Provides information about an error that occurred due to a versioning conflict for a specified resource.</p>
        capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
        capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
        capo_macie2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Provides information about an error that occurred due to one or more service quotas for an account.</p>
        capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
        capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_macie2.types.create_member_request.CreateMemberRequest]",
    ) -> OperationResponse[
        "capo_macie2.types.create_member_response.CreateMemberResponse"
    ]:
        import capo_macie2._operations.macie2.create_member

        output, http_response = (
            capo_macie2._operations.macie2.create_member.create_member(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateMember")
    )
    input_: capo_macie2.types.create_member_request.CreateMemberRequest = {}
    if account is not None:
        input_["account"] = account
    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