Skip to content

create_configured_audience_model_association

create_configured_audience_model_association(
    membership_identifier: MembershipIdentifier,
    configured_audience_model_arn: ConfiguredAudienceModelArn,
    configured_audience_model_association_name: ConfiguredAudienceModelAssociationName,
    manage_resource_policies: bool,
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
    tags: Optional[TagMap] = None,
    description: Optional[ResourceDescription] = None,
) -> CreateConfiguredAudienceModelAssociationOutput

Provides the details necessary to create a configured audience model association.

Parameters:

  • membership_identifier (MembershipIdentifier) –

    A unique identifier for one of your memberships for a collaboration. The configured audience model is associated to the collaboration that this membership belongs to. Accepts a membership ID.

  • configured_audience_model_arn (ConfiguredAudienceModelArn) –

    A unique identifier for the configured audience model that you want to associate.

  • configured_audience_model_association_name (ConfiguredAudienceModelAssociationName) –

    The name of the configured audience model association.

  • manage_resource_policies (bool) –

    When TRUE, indicates that the resource policy for the configured audience model resource being associated is configured for Clean Rooms to manage permissions related to the given collaboration. When FALSE, indicates that the configured audience model resource owner will manage permissions related to the given collaboration.

    Setting this to TRUE requires you to have permissions to create, update, and delete the resource policy for the cleanrooms-ml resource when you call the DeleteConfiguredAudienceModelAssociation resource. In addition, if you are the collaboration creator and specify TRUE, you must have the same permissions when you call the DeleteMember and DeleteCollaboration APIs.

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

    An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.

  • description (Optional[ResourceDescription], default: None ) –

    A description of the configured audience model association.

Raises:

Source code in docs_src/capo_cleanrooms/_services/clean_rooms.py
def create_configured_audience_model_association(
    self,
    membership_identifier: "capo_cleanrooms.types.membership_identifier.MembershipIdentifier",
    configured_audience_model_arn: "capo_cleanrooms.types.configured_audience_model_arn.ConfiguredAudienceModelArn",
    configured_audience_model_association_name: "capo_cleanrooms.types.configured_audience_model_association_name.ConfiguredAudienceModelAssociationName",
    manage_resource_policies: bool,
    *,
    config_overrides: Optional[CleanRoomsClientConfig] = None,
    tags: Optional["capo_cleanrooms.types.tag_map.TagMap"] = None,
    description: Optional[
        "capo_cleanrooms.types.resource_description.ResourceDescription"
    ] = None,
) -> "capo_cleanrooms.types.create_configured_audience_model_association_output.CreateConfiguredAudienceModelAssociationOutput":
    """<p>Provides the details necessary to create a configured audience model association.</p>

    Args:
        membership_identifier: <p>A unique identifier for one of your memberships for a collaboration. The configured audience model is associated to the collaboration that this membership belongs to. Accepts a membership ID.</p>
        configured_audience_model_arn: <p>A unique identifier for the configured audience model that you want to associate.</p>
        configured_audience_model_association_name: <p>The name of the configured audience model association.</p>
        manage_resource_policies: <p>When <code>TRUE</code>, indicates that the resource policy for the configured audience model resource being associated is configured for Clean Rooms to manage permissions related to the given collaboration. When <code>FALSE</code>, indicates that the configured audience model resource owner will manage permissions related to the given collaboration.</p> <p>Setting this to <code>TRUE</code> requires you to have permissions to create, update, and delete the resource policy for the <code>cleanrooms-ml</code> resource when you call the <a>DeleteConfiguredAudienceModelAssociation</a> resource. In addition, if you are the collaboration creator and specify <code>TRUE</code>, you must have the same permissions when you call the <a>DeleteMember</a> and <a>DeleteCollaboration</a> APIs.</p>
        tags: <p>An optional label that you can assign to a resource when you create it. Each tag consists of a key and an optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM policies to control access to this resource.</p>
        description: <p>A description of the configured audience model association.</p>

    Raises:
        capo_cleanrooms.errors.access_denied_exception.AccessDeniedException: <p>Caller does not have sufficient access to perform this action.</p>
        capo_cleanrooms.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_cleanrooms.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_cleanrooms.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_cleanrooms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request denied because service quota has been exceeded.</p>
        capo_cleanrooms.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_cleanrooms.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_cleanrooms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cleanrooms.types.create_configured_audience_model_association_input.CreateConfiguredAudienceModelAssociationInput]",
    ) -> OperationResponse[
        "capo_cleanrooms.types.create_configured_audience_model_association_output.CreateConfiguredAudienceModelAssociationOutput"
    ]:
        import capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.create_configured_audience_model_association

        output, http_response = (
            capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.create_configured_audience_model_association.create_configured_audience_model_association(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateConfiguredAudienceModelAssociation"),
    )
    input_: capo_cleanrooms.types.create_configured_audience_model_association_input.CreateConfiguredAudienceModelAssociationInput = {
        "membership_identifier": membership_identifier,
        "configured_audience_model_arn": configured_audience_model_arn,
        "configured_audience_model_association_name": configured_audience_model_association_name,
        "manage_resource_policies": manage_resource_policies,
    }
    if tags is not None:
        input_["tags"] = tags
    if description is not None:
        input_["description"] = description

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